Merge pull request #57 from omarroth/update-playbackrate

Update playbackRate after switching qualities
This commit is contained in:
Jeremy Thomerson 2020-04-26 20:27:08 -04:00 committed by GitHub
commit d40a5fb271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,7 @@ module.exports = function(videojs) {
function changeQuality(event, newSource) { function changeQuality(event, newSource) {
var sources = player.currentSources(), var sources = player.currentSources(),
currentTime = player.currentTime(), currentTime = player.currentTime(),
currentPlaybackRate = player.playbackRate(),
isPaused = player.paused(), isPaused = player.paused(),
selectedSource; selectedSource;
@ -49,6 +50,7 @@ module.exports = function(videojs) {
// player's `src` is updated but the player's `currentTime` has not yet // player's `src` is updated but the player's `currentTime` has not yet
// been set by the SafeSeek operation. // been set by the SafeSeek operation.
player._qualitySelectorSafeSeek = new SafeSeek(player, currentTime); player._qualitySelectorSafeSeek = new SafeSeek(player, currentTime);
player.playbackRate(currentPlaybackRate);
} }
if (!isPaused) { if (!isPaused) {