var tag = document.createElement(“script”); tag.src = “https://www.youtube.com/iframe_api”; var firstScriptTag = document.getElementsByTagName(“script”); firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubeIframeAPIReady() { player…