diff options
author | Alejandro Iglesias <ale.garciaiglesias@gmail.com> | 2017-04-27 11:53:53 -0300 |
---|---|---|
committer | Alejandro Iglesias <ale.garciaiglesias@gmail.com> | 2017-04-27 11:53:53 -0300 |
commit | b04301c211f4a5c32ee19aefdb94b9b67219efc7 (patch) | |
tree | a2cc3f6fbd430346df8dc9c13a217dc1aa337f70 /src | |
parent | 97157efcfa51297324046087ad787ed346a39f06 (diff) | |
download | plyr-b04301c211f4a5c32ee19aefdb94b9b67219efc7.tar.lz plyr-b04301c211f4a5c32ee19aefdb94b9b67219efc7.tar.xz plyr-b04301c211f4a5c32ee19aefdb94b9b67219efc7.zip |
Implement loop in YouTube
Diffstat (limited to 'src')
-rw-r--r-- | src/js/plyr.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index fd823bbc..20a4ca31 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -2515,6 +2515,13 @@ // 5 Video cued switch (event.data) { case 0: + // YouTube doesn't support loop for a single video, so mimick it. + if (config.loop.active) { + // YouTube needs a call to `stopVideo` before playing again + instance.stopVideo(); + instance.playVideo(); + break; + } player.elements.media.paused = true; trigger(player.elements.media, 'ended'); break; |