Home > Forum > Plugins > Embed a videoplayer

Embed a videoplayer
0

MVP

Hi,

You can use html attribute to embed the player.
As for video status tracking, perhaps with js you can get that, but I don't know. Out of curiosity, I'll try to check it out, unless someone provides a ready-made solution beforehand.

Regards

--Edit , The script will display an alert when the video ends, you can insert another script ,










var player;

function onYouTubeIframeAPIReady() {
player = new YT.Player('youtube-player', {
events: {
'onStateChange': onPlayerStateChange
}
});
}

function onPlayerStateChange(event) {
if (event.data === YT.PlayerState.ENDED) {
// Show alert when the video ends
alert('End of video :) ');
}
}
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);


Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings