When a video is playing on chromecast, and the chromecast is disconnected, the video is paused even though it should be playing according to _reloadTech.
Expected
Video should resume playing in browser if it was playing on the chromecast after disconnecting.
Do not pause the video, and disconnect the chromecast.
The video is now paused even though it should be playing.
Possible solutions
I've been debugging this, and if I put a player.load() inside the ready function, it seems to work.
_reloadTech() {
var player = this.player,
currentTime = player.currentTime(),
wasPaused = player.paused(),
sources = player.currentSources();
// Reload the current source(s) to re-lookup and use the currently available Tech.
// The chromecast Tech gets used if `ChromecastSessionManager.isChromecastConnected`
// is true (effectively, if a chromecast session is currently in progress),
// otherwise Video.js continues to search through the Tech list for other eligible
// Tech to use, such as the HTML5 player.
player.src(sources);
player.ready(function() {
player.load(); // added this
if (wasPaused) {
player.pause();
} else {
player.play();
}
player.currentTime(currentTime || 0);
});
}
Please let me know if this is a OK solution, I will create a PR for it.
Problem
When a video is playing on chromecast, and the chromecast is disconnected, the video is paused even though it should be playing according to
_reloadTech
.Expected
Video should resume playing in browser if it was playing on the chromecast after disconnecting.
Reproduction
Possible solutions
I've been debugging this, and if I put a
player.load()
inside the ready function, it seems to work.Please let me know if this is a OK solution, I will create a PR for it.
Versions videojs:
8.9.0
silvermine/videojs-chromecast:1.5.0