I use the plyr plugin to play videos on my site.
I try to restart the player (vimeo) when the video ends, but I was not very lucky. I am even trying to hide a log message, and this does not even work. Can anyone see where I'm wrong?
JSfiddle is attached here.
if ($('.main-hero__youtube__video').length) {
console.log("Video player init");
var plyr_options = {
autoplay: true,
clickToPlay: true,
showPosterOnEnd: true,
controls: ['mute','progress','play']
};
var players = plyr.setup(plyr_options);
players[0].on('ended', function(event) {
console.log("test");
});
}
source
share