title: Youtube Javascript player ASPI "ytplayer is not a function"
body: <p>I have this code in html:</p>
  
  <pre><code>        &lt;div class="flex-video widescreen youtube"&gt;
              &lt;iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/{{Video.v_id}}?autoplay=1&amp;enablejsapi=1&amp;autohide=1" frameborder="0" allowfullscreen&gt; &lt;/iframe&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>and this code in Javascript:</p>
  
  <pre><code>        function onYouTubePlayerReady(playerId) {
              console.log("player ready");
              ytplayer = document.getElementById("ytplayer");
          }
  </code></pre>
  
  <p>When I type in Firefox console this:</p>
  
  <pre><code>ytplayer.playVideo();
  </code></pre>
  
  <p>I get the not function error:</p>
  
  <blockquote>
    <p>TypeError: ytplayer.playVideo is not a function</p>
  </blockquote>
  
  <p>Also the <code>console.log("player ready");</code> does not print at all.</p>
  
  <p>Can anybody help me?</p>
  
  <p>I want to controll the player with javascript api not with the IFrame api.
  And I want the video player to be in html5.</p>
  
  <p>edit:
  I have the jspapi enabled (enablejsapi=1)</p>