I'm getting an error and i dont find any clues, i'm using videojs to control multiple video in a slider, on each completed transition, i call a new instance of videojs and and store the ID into a variable and dispose() the old videojs. Since i have lot of slide (or videos) and want to kill them when there are not active for performance. My slider work under TweenMax.. and i call the dispose() in the onStart event from a Timline. When the dispose() is called, i'm getting this error :
Uncaught TypeError: Cannot read property 'vdata1408997779453' of null
This is a sample of my code :
var $slides = [],
videos =[],
currentSlide = 0,
currentVideo = null;
$(function(){
TweenLite.to($('#header-wrap'), 1, {
left: x,
onStart: function(){
if(currentVideo) {
TweenMax.set($('.video-holder'), {autoAlpha: 0});
currentVideo.dispose();
}
},
onComplete: function() {
if(videos[slideActive].url) {
videojs('movie-video-holder-'+slideActive+'', {"autoplay": false, "preload": "auto", "controls": false, "lopp": false}, function(){
currentVideo = $vid;
[...]
});
}
}
[...]
Thanks!
This looks like it's related to https://github.com/videojs/video.js/pull/1481
A really nasty hack (until the patch is merged) would be to pause the player, wait for the frame after the error, then dispose of the player:
player.pause();
setTimeout(function() {
player.dispose();
}, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With