aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-10-24 22:37:49 +1100
committerGitHub <noreply@github.com>2018-10-24 22:37:49 +1100
commitaa20ebaa9c38363c0d1720bbb6c3c37eef630393 (patch)
treef58a75373b1cedfc10e81a72be68f3913438264f
parent779e45c11b72144d2762eb43689d7f5478450109 (diff)
parent06db3f702d21ec440d53451ce8cb115f036ddec4 (diff)
downloadplyr-aa20ebaa9c38363c0d1720bbb6c3c37eef630393.tar.lz
plyr-aa20ebaa9c38363c0d1720bbb6c3c37eef630393.tar.xz
plyr-aa20ebaa9c38363c0d1720bbb6c3c37eef630393.zip
Merge pull request #1211 from melbahja/develop
duration after changing video quality
-rw-r--r--src/js/plyr.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 32038b0e..621ce207 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -683,6 +683,7 @@ class Plyr {
set quality(input) {
const config = this.config.quality;
const options = this.options.quality;
+ const { duration, playing } = this;
if (!options.length) {
return;
@@ -706,6 +707,14 @@ class Plyr {
// Set quality
this.media.quality = quality;
+
+ // Seek to duration before changing quality
+ this.seek = duration;
+
+ // Continue
+ if (playing) {
+ this.play();
+ }
}
/**