loop video

This commit is contained in:
Tomáš Mládek 2020-01-10 16:15:47 +01:00
parent 607b845abc
commit fd11ab1ca1

View file

@ -75,8 +75,13 @@ export default class Channel extends Vue {
playerVars: {"autoplay": 0}, playerVars: {"autoplay": 0},
}); });
this.youtubePlayer.on("stateChange", (event) => { this.youtubePlayer.on("stateChange", (event) => {
if (event.data == PlayerStates.BUFFERING) { switch (event.data) {
case PlayerStates.BUFFERING:
this.state = ChannelState.READY; this.state = ChannelState.READY;
break;
case PlayerStates.ENDED:
this.youtubePlayer!.playVideo();
break;
} }
}); });
} }