title: Not able to load all the youtube iframe players on same page. Always loads the last one
body: <p>My base Html </p>
  
  <pre><code>    &lt;div class="ytplayer" id="player1" data-videoid="xxxxxxx" data-playerheight="390" data-playerwidth="640"&gt;&lt;/div&gt;
      &lt;div class="ytplayer" id="player2" data-videoid="xxxxxxx" data-playerheight="390" data-playerwidth="640"&gt;&lt;/div&gt;
      &lt;div class="ytplayer" id="player3" data-videoid="xxxxxxx" data-playerheight="390" data-playerwidth="640"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>My script initialization is </p>
  
  <pre><code>    $(document).ready(function(){
          $(".ytplayer")._loadIFramePlayer();
      });
  </code></pre>
  
  <p>my functions look like </p>
  
  <pre><code>    _loadIFramePlayer: function(){  
  
                  $("&lt;script&gt;")
                      .attr("src", "//www.youtube.com/iframe_api")
                      .insertBefore($("body").find("script").first());                        
  
                  var _youtubePlayer = null;
  
                  if (typeof (YT) === 'undefined' || typeof (YT.Player) === 'undefined') {                                
                          window.onYouTubeIframeAPIReady = function () {
  
                                  _youtubePlayer = new YT.Player("player", {
                                  height: "390",
                                  width: "640",
                                  videoId: "xxxxxx",
                                  events: {
                                      // i didn't mention the below functions since I am not doing any thing there, just calling stopVideo and playVideo native functions of youtube api.
                                      'onReady': onPlayerReady,
                                      'onStateChange': onPlayerStateChange
                                  }
                              });
                          };
  
                          $.getScript('//www.youtube.com/iframe_api');
                  } else {
                          _youtubePlayer = new YT.Player("player", {
                                  height: "390",
                                  width: "640",
                                  videoId: "xxxxxx",
                                  events: {
                                      // i didn't mention the below functions since I am not doing any thing there, just calling stopVideo and playVideo native functions of youtube api.
                                      'onReady': onPlayerReady,
                                      'onStateChange': onPlayerStateChange
                                  }
                              });
                  }
              }   
  </code></pre>
  
  <p>Ideally we should get three instances of iframe player but in our case we are getting only one player that too the last one in all cases. Please let me know if any work around for this ..</p>