title: Display video duration from videoJS
body: <p>I am working on an HTML5 video player with jQuery. For now I have my video player working very well but I want to get the variable for the video duration and show/display it in pure HTML page.</p>
  
  <p>So from here you can take more info about this Jquery video player:
  <a href="http://www.videojs.com/docs/api/" rel="nofollow noreferrer">http://www.videojs.com/docs/api/</a></p>
  
  <p>I think the variable for video duration is: <code>myPlayer.duration();</code></p>
  
  <p>How I can display this value in HTML?</p>
  
  <p>Here is my HTML code to display the player:</p>
  
  <pre><code>  &lt;video id="vemvo-player" class="video-js vjs-default-skin" controls autoplay="true" width="950" height="534"
        data-setup="{}"&gt;
      &lt;source src="[var.base_url]/uploads/[var.video_play]" type='video/flv' /&gt;
    &lt;/video&gt;
  </code></pre>
  
  <p>This is what I have tried to display this variable but it says that it is = "0" when on the video player it says that it's 4min:</p>
  
  <pre><code>  &lt;video id="vemvo-player" class="video-js vjs-default-skin" controls autoplay="true" width="950" height="534"
        data-setup="{}"&gt;
      &lt;source src="[var.base_url]/uploads/[var.video_play]" type='video/flv' /&gt;
    &lt;/video&gt;
  &lt;div id="duration"&gt;&lt;/div&gt;
  &lt;script type="text/javascript"&gt;
      _V_("vemvo-player").ready(function(){
          var myPlayer = this;
          var howLongIsThis = myPlayer.duration();
          $('#duration').html('Duration: ' + howLongIsThis);
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Where is my mistake?</p>