title: Problems with youtube API function
body: <p>I am looking for a way to have <code>player.getDuration()</code> and <code>player.getCurrentTime()</code> from <a href="https://developers.google.com/youtube/iframe_api_reference" rel="nofollow">youtube API</a>, written in normal time (Minute:Seconds) Like this bellow:</p>
  
  <pre><code>var mind = player.getCurrentTime() /*or player.getDuration()*/  % (60 * 60);
  var m = Math.floor(mind / 60);
  
  var secd = mind % 60;
  var s = Math.ceil(secd)
  
  document.write(m,":",s); seconds;
  </code></pre>
  
  <p>But it keeps sending an error <code>NaN:NaN</code></p>
  
  <p>Also I want to change an image when the video has finished using the function <code>YT.PlayerState.ENDED</code> like this:</p>
  
  <pre><code>if(YT.PlayerState.ENDED){
   $("#change").attr('src', "../play button.png");
               }
  </code></pre>
  
  <p>But it is not working?</p>