Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VIDEOJS: WARN: Player x is already initialised. Options will not be applied.

See original GitHub issue

Issue Description

Hey everyone, first of all I want to thank for this awesome player! I made a really nice skin to look nice for my website, but… I been having issues with design elements and couple of errors which I hope some of you can help me with that.

I use Gridder v1.4 for my videos to appear once the image is clicked, and they are working just fine, I can play the video etc, but once I close and reopen the same video I get this error:

     VIDEOJS: WARN: Player "(my unique id)" is already initialised. Options will not be applied.

and then all of the design disapears from the player…

Plus I have this error for each video I output on the website:

     Uncaught TypeError: The element or ID supplied is not valid. (videojs)

I tryed to fix it using code which I found on other topis regarding this, but It did not work.

You can see all working website at: (NOTE : this is an adult website!)

Any help will be appreciated!

This code is used for the gridder and placed in a very bottom of the page:

        jQuery(document).ready(function ($) {
                scroll: true,
                scrollOffset: 60,
                scrollTo: "panel", // panel or listitem
                animationSpeed: 400,
                animationEasing: "easeInOutExpo",
                showNav: true,
                closeText: "Close",

And this is code to call the player:

   <div id="gridder-content-'.$row['id'].'" class="gridder-content">
          <div class="player">
          <script type="text/javascript">
           <video id="my_video_'.$row['id'].'" class="video-js vjs-default-skin" width="1197px" height="673px" controls preload="none" poster="upl/cover/video/'.$row['image'].'">
            <source src="v/'.$row['url'].'" type="video/mp4" />

Which is abowe the gridder code.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

thijstriemstracommented, Oct 8, 2015

It’s a really weird ID isn’t it? my_video_'.$row['id'].' If this is evaluated by the library you’re using then you probably shouldn’t hardcode the html elements but create the video.js player using javascript/that library. Closing this since it doesn’t look related to this plugin anymore. Feel free to re-open with an example that can reproduce an error (without any third-party libraries used).

KENYHUcommented, Apr 2, 2019

Hi man, you can do like this:

var player; if( player == undefind ) { player = videojs(‘xxxx_div’, {}); //if videojs player don’t exists, you can create one } else { $(“#video_div”).attr(‘src’, source); //change video source player.load(); //reload videoJS }

Read more comments on GitHub >

github_iconTop Results From Across the Web

player is already initialised options will not be applied, videojs
VIDEOJS : WARN: Player "media" is already initialized. Options will not be applied. The bizarre thing is that it has not been initialized....
Read more >
Video.js Options Reference
The standard options available when creating a Video.js player. ... does not already have an id , this value is used as the...
Read more >
Why video is not playing, first time it will play on dynamically ...
You are initializing video player again and again, but I think you just need to change source. Please try following.
Read more >
video js - JSFiddle - Code Playground
The fiddle listings (Public, Private, Titled, etc) will now display latest versions instead of the ones saved as Base versions - this was...
Read more >
Videojs - How to change src dynamically - The Web Blinders
VIDEOJS : Dynamically change src of a video. VIDEOJS : WARN: Player x is already initialised. Options will not be applied. You will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found