VIDEOJS: WARN: Player x is already initialised. Options will not be applied.
See original GitHub issueIssue 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: www.xxxtu.be (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:
<script>
jQuery(document).ready(function ($) {
$(".gridder").gridderExpander({
scroll: true,
scrollOffset: 60,
scrollTo: "panel", // panel or listitem
animationSpeed: 400,
animationEasing: "easeInOutExpo",
showNav: true,
closeText: "Close",
});
});
</script>
And this is code to call the player:
<div id="gridder-content-'.$row['id'].'" class="gridder-content">
<div class="player">
<script type="text/javascript">
videojs("my_video_'.$row['id'].'").ready(function(){});
</script>
<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" />
</video>
</div>
</div>
Which is abowe the gridder code.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
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).Hi man, you can do like this: