aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 7cfa5386..cad45d66 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
-// plyr.js v3.6.8
+// plyr.js v3.6.12
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================
@@ -72,7 +72,7 @@ class Plyr {
(() => {
try {
return JSON.parse(this.media.getAttribute('data-plyr-config'));
- } catch (e) {
+ } catch (_) {
return {};
}
})(),
@@ -675,7 +675,9 @@ class Plyr {
// Set media speed
setTimeout(() => {
- this.media.playbackRate = speed;
+ if (this.media) {
+ this.media.playbackRate = speed;
+ }
}, 0);
}
@@ -956,6 +958,7 @@ class Plyr {
*/
set currentTrack(input) {
captions.set.call(this, input, false);
+ captions.setup();
}
/**
@@ -1030,6 +1033,23 @@ class Plyr {
}
/**
+ * Sets the preview thubmnails for the current source
+ */
+ setPreviewThumbnails(thumbnailSource) {
+ if (this.previewThumbnails && this.previewThumbnails.loaded) {
+ this.previewThumbnails.destroy();
+ this.previewThumbnails = null;
+ }
+
+ Object.assign(this.config.previewThumbnails, thumbnailSource);
+
+ // Create new instance if it is still enabled
+ if (this.config.previewThumbnails.enabled) {
+ this.previewThumbnails = new PreviewThumbnails(this);
+ }
+ }
+
+ /**
* Trigger the airplay dialog
* TODO: update player with state, support, enabled
*/