aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-03-18 22:46:36 +1100
committerSam Potts <sam@potts.es>2018-03-18 22:46:36 +1100
commitbb7eea27e513bf33dd4a4d846b3234b37a5be48d (patch)
treea4b4d2046710d1ad433c49a3f3f98e66b5ddbdf1 /src/js/plyr.js
parent595c5e95bcae4927910b5166d41a4ba3032560d6 (diff)
downloadplyr-bb7eea27e513bf33dd4a4d846b3234b37a5be48d.tar.lz
plyr-bb7eea27e513bf33dd4a4d846b3234b37a5be48d.tar.xz
plyr-bb7eea27e513bf33dd4a4d846b3234b37a5be48d.zip
v3.0.2
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 37dd14d3..bd4ec020 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
-// plyr.js v3.0.1
+// plyr.js v3.0.2
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================
@@ -474,7 +474,7 @@ class Plyr {
const fauxDuration = parseInt(this.config.duration, 10);
// True duration
- const realDuration = Number(this.media.duration);
+ const realDuration = this.media ? Number(this.media.duration) : 0;
// If custom duration is funky, use regular duration
return !Number.isNaN(fauxDuration) ? fauxDuration : realDuration;
@@ -1139,7 +1139,7 @@ class Plyr {
clearInterval(this.timers.playing);
// Destroy YouTube API
- if (this.embed !== null) {
+ if (this.embed !== null && utils.is.function(this.embed.destroy)) {
this.embed.destroy();
}