diff options
author | Sam Potts <me@sampotts.me> | 2016-10-23 15:18:08 +1100 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2016-10-23 15:18:08 +1100 |
commit | 08b4c09b896e1ad27c7a7f974e98831eec294019 (patch) | |
tree | 96bfe5d50b9a552156168d6bf8a3645b9e6fae63 /src | |
parent | a509a5e1bc6a1ada4e56e326f01396292821bf27 (diff) | |
download | plyr-08b4c09b896e1ad27c7a7f974e98831eec294019.tar.lz plyr-08b4c09b896e1ad27c7a7f974e98831eec294019.tar.xz plyr-08b4c09b896e1ad27c7a7f974e98831eec294019.zip |
Temporary patch for the YouTube API issues with `getDuration()` (relates to #374)
Diffstat (limited to 'src')
-rw-r--r-- | src/js/plyr.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index 703aee9c..c2e3a621 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1737,6 +1737,14 @@ _triggerEvent(plyr.media, 'timeupdate'); }, 100); + // Check duration again due to YouTube bug + // https://github.com/Selz/plyr/issues/374 + // https://code.google.com/p/gdata-issues/issues/detail?id=8690 + if (plyr.media.duration !== instance.getDuration()) { + plyr.media.duration = instance.getDuration(); + _triggerEvent(plyr.media, 'durationchange'); + } + break; case 2: |