Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Add compatibility with videojs 4.6 #4

Closed
triwav opened this issue Jul 29, 2014 · 1 comment
Closed

Add compatibility with videojs 4.6 #4

triwav opened this issue Jul 29, 2014 · 1 comment

Comments

@triwav
Copy link

triwav commented Jul 29, 2014

Updating to version 4.6 causes an issue when you try to resume playback locally in Chrome. The issue is in
vjs.ChromeCastComponent.prototype.onStopAppSuccess. I think the issue is this gets run:
this.player_.src(this.player_.options_['sources']);
and in 4.6 the player now resets when you change the source
videojs/video.js#1124

The below code solves this but is not the correct way to do it. The key here is running load() to get it to reload the file locally.

// Fix for 4.6 not working correctly otherwise
this.player_.load();

var context = this;
setTimeout(function(){
if (context.apiMedia.playerState == "IDLE") {
    context.player_.currentTime(0);
    context.player_.onPause();
} else {

    if (!this.paused) {
        context.player_.play();
    }
    context.player_.currentTime(context.currentMediaTime);
}
this.apiMedia = null;
},500);
@triwav
Copy link
Author

triwav commented Aug 12, 2014

This appears the to be the cause of the issue:
videojs/video.js#1389

Implementing the isready = false solves this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants