2

I used a jPlayer control to play a music part and songs. I want to get the specific time during the jPlayer play, but i can't.

How can i get the current time of the song playing?

Alexander
  • 23,432
  • 11
  • 63
  • 73
KimoKono
  • 91
  • 2
  • 5
  • This is the first result on Google for "jplayer get current position", and the question makes total sense if you are working with JPlayer. Have a look at their API docs: http://jplayer.org/latest/developer-guide/ it's completely unclear how to get the current playback time from within an event handler (as evidenced by the complexity of the much upvoted answer!). IOW: This is a good question, and it should not have been closed. At most, it's a duplicate of http://stackoverflow.com/questions/6377441/jplayer-2-0-elapsed-remaining-time – hraban Oct 24 '16 at 14:10

1 Answers1

10

Take this:

$("#yourPlayer").data("jPlayer").status.currentTime

Also, take a look here: jPlayer 2.0 Elapsed/Remaining Time

Community
  • 1
  • 1
David Müller
  • 5,291
  • 2
  • 29
  • 33
  • i try it but it dosent work i want for example when the jplayer come to secound 5 show an alert message here is my code //if($("#jquery_jplayer_1").jPlayer.status.currentTime==5) if($("#jquery_jplayer_1").data("jPlayer").status.currentTime=="00:03") { alert("hello"); }); } – KimoKono Dec 09 '12 at 18:55