fix: continue with the current duration after changing video quality

This commit is contained in:
Mohamed Elbahja
2018-10-13 12:59:59 +01:00
parent fac134dd95
commit a2a82a96a6

View File

@ -680,6 +680,8 @@ class Plyr {
set quality(input) {
const config = this.config.quality;
const options = this.options.quality;
const duration = this.duration;
const isPlaying = this.playing;
if (!options.length) {
return;
@ -703,6 +705,14 @@ class Plyr {
// Set quality
this.media.quality = quality;
// seek to duration before changing quality
this.seek = duration;
// continue
if (isPlaying) {
this.play();
}
}
/**