Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use jwplayer to get current play time

I am using jwplayer to play embedded video, the javascript api tells me

jwplayer("mediaplayer").getPosition()

will get the current position, but my result is undefined

Can anyone help me get the correct resilts

like image 877
wumengjun Avatar asked Jan 17 '23 16:01

wumengjun


1 Answers

Works fine for me just how the documentation specifies :

<div id="container"></div>


jwplayer("container").setup({
    file: "http://content.bitsontherun.com/videos/nPripu9l-60830.mp4",
    flashplayer: "http://player.longtailvideo.com/player.swf",
    image: "http://content.bitsontherun.com/thumbs/nPripu9l-480.jpg",
    height: 270,
    width: 480
});
var state = jwplayer("container").getState();
var elapsed = jwplayer("container").getPosition();
like image 156
Manse Avatar answered Jan 25 '23 00:01

Manse



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!