Take the 2-minute tour ×  Let me explain my scenario. I want to
use Youtube IFrame API to embed some videos on my website. I
tested the video with id wdGZBRAwW74
(https://www.youtube.com/watch?v=wdGZBRAwW74) on this page:
Youtube IFrame Player Demo. And it works OK.  I try this example
code:  <!DOCTYPE html> <!-- 1. The <iframe> (and video player)
will replace this <div> tag. --> <div id="player"></div>    //
2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');   tag.src =
"//www.youtube.com/iframe_api";
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
//    after the API code downloads.   var player;   function
onYouTubeIframeAPIReady() {     player = new YT.Player('player',
{       height: '390',       width: '640',       videoId:
'wdGZBRAwW74',       events: {         'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange,         'onError':
onPlayerError