Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get current playback time in video.js

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 ?

like image 365
hiteshtr Avatar asked Mar 26 '12 10:03

hiteshtr


People also ask

How do you get duration on Videojs?

I think the variable for video duration is: myPlayer. duration();

Why is video duration NaN?

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.

How do I initialize a video in JavaScript?

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.

What is Player js?

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.


1 Answers

var whereYouAt = myPlayer.currentTime();

http://docs.videojs.com/docs/api/player.html#MethodscurrentTime

like image 198
joncys Avatar answered Sep 20 '22 14:09

joncys