Trying to get full video duration but returning as Nan
<p>I am trying to get the video duration of my player but it returns <code>NaN</code>, I am not entirely sure how to access it from here.</p>

<pre><code>&lt;video id="videoPlayerNew" class="video-js vjs-default-skin vjs-controls-enabled" poster="http://camendesign.com/code/video_for_everybody/poster.jpg" data-setup="{}" controls=""&gt;
    &lt;source src="sample.mp4" type="video/mp4"&gt;
    &lt;p class="vjs-no-js"&gt;Javascript was disabled or not supported&lt;/p&gt;
&lt;/video&gt;

&lt;script&gt;
    var vid = document.getElementById("videoPlayerNew");
    console.log(vid.duration);
&lt;/script&gt;
</code></pre>

<p>The log tells me: <code>NaN</code></p>