From fd11ab1ca1effc70d69c8a0b45c70484610f0b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Fri, 10 Jan 2020 16:15:47 +0100 Subject: [PATCH] loop video --- src/components/Channel.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Channel.vue b/src/components/Channel.vue index e37dbe6..6c13664 100644 --- a/src/components/Channel.vue +++ b/src/components/Channel.vue @@ -75,8 +75,13 @@ export default class Channel extends Vue { playerVars: {"autoplay": 0}, }); this.youtubePlayer.on("stateChange", (event) => { - if (event.data == PlayerStates.BUFFERING) { - this.state = ChannelState.READY; + switch (event.data) { + case PlayerStates.BUFFERING: + this.state = ChannelState.READY; + break; + case PlayerStates.ENDED: + this.youtubePlayer!.playVideo(); + break; } }); }