Start, pause, change src using setTimeout(Medium)

Description

The first timeout starts the video after 3 seconds, after 10 seconds the second timeout function stops the video and after 15 seconds the third timeout changes the src of the video.

var videoContainer = document.getElementById('7e6f5796-aa1b-4c5b-9b62-5d64c66597s6');
var video = videoContainer.children[0];

setTimeout(function(){
window.youtubeVideos['YouTube_Video_ID'].playVideo();
}, 3000);

setTimeout(function(){
window.youtubeVideos['YouTube_Video_ID'].pauseVideo();
}, 10000);

setTimeout(function(){
video.src = "https://www.youtube.com/embed/NEW_YouTube_Video_ID";
}, 15000);

Close Menu
Close Panel