I am trying to get the video duration of my player but it returns NaN
, I am not entirely sure how to access it from here.
<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="">
<source src="sample.mp4" type="video/mp4">
<p class="vjs-no-js">Javascript was disabled or not supported</p>
</video>
<script>
var vid = document.getElementById("videoPlayerNew");
console.log(vid.duration);
</script>
The log tells me: NaN