// onYouTubeIframeAPIReady() is called when the IFrame API is ready to go.

functiononYouTubeIframeAPIReady(){

player=newYT.Player('player',{

videoId:'AcwMPny1uCo',// the ID of the video (mentioned above)

playerVars:{

autoplay:1,// start automatically

controls:0,// don't show the controls (we can't click them anyways)

modestbranding:0,// show smaller logo

loop:0,// loop when complete

playlist:'AcwMPny1uCo'// required for looping, matches the video ID

},

events:{

'onReady':function(e){

e.target.mute();

}

}

});

}

</script>

</body>

</html>

Click Save to save the player.

All we now need to do is replace the YouTube Video ID in the player code, with the ID of the video we want in the background.
But wait. There’s more. We can also configure options like whether we want the video to start automatically, or whether we want the video controls to show up. These options are available in the onYouTubeIframeAPIReady() function… just follow the comments!