Implement loop in YouTube
This commit is contained in:
parent
97157efcfa
commit
b04301c211
4
dist/plyr.js
vendored
4
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user