I am using video.js project to play videos on my web page. I implemented it perfectly on my web page but i required to retrieve the video's current playing time how can i do that ?
I think the variable for video duration is: myPlayer. duration();
The Video duration property is a read-only property. The Video duration function returns “NaN” if no video is set whereas if the video is streamed and has no predefined length, it returns “Inf” (Infinity). Below program illustrates the Video duration Property : Example: Getting the length of a video.
js setup methods are used to initialize a video. var myPlayer = videojs('example_video_1'); In the following example, the data-setup attribute tells the Video. js library to create a player instance when the library is ready.
js. A JavaScript library that allows developers to programmatically control video and audio within IFrames across a number of services. Publishers can also expose a JavaScript API for developers to build rich applications with their media. Read The Documentation Demos.
var whereYouAt = myPlayer.currentTime();
http://docs.videojs.com/docs/api/player.html#MethodscurrentTime
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With