Brandon Brown
Brandon Brown

Reputation: 341

Video.js Flash fallback only works the first time page loads in IE7/8

I am having a problem with the video.js flash fallback in IE7 and IE8. The first time you load a page containing video, everything works as expected-the video plays. But, if you click on a link to another page in the app and then come back to the page with the video on it using a link or a browser back button, you will only see a black square - the video will not play. If I reload the page, however, the video will again play as expected.

Someone described the same issue here: http://help.videojs.com/discussions/problems/869-videojs-version-3-doesnt-work-on-ie7-ie8. They fixed it by "adding this in HTML header: V.options.flash.swf = 'http://' + document.domain +"/js/video-js/video-js.swf?"; It forces IE7 and IE8 to reload the flash file..."

I tried this solution, but I'm not having any luck. Can anyone tell me how to fix this or at least explain what may be happening and how I should be troubleshooting it. Many thanks in advance.

Upvotes: 1

Views: 1552

Answers (1)

Soph
Soph

Reputation: 11

Inside the videojs ready function, make a call to ended event. Making the current time as 0 works for ie.

var myPlayer = videojs("vidModal"); //where vidModal is the id
myPlayer.on('ended', function() {

    myPlayer.currentTime(0);
    myPlayer.pause();
    myPlayer.posterImage.hide();
});

Upvotes: 1

Related Questions