views:

75

answers:

1

Can anyone help me create a javascript/jquery function to control the HTML5 audio tag control seekbar?? (Or suggest me a web resource from where I can learn). I want to customize the looks of the default controls and so I want to handle the progress in a different <div>. How can I achieve that?

A: 

Use any JavaScript slider control that you want and do two things:

  • listen for changes (clicks) and set audioNode.currentTime
  • conversely, periodically set the slider's value to audioNode.currentTime
Delan Azabani
My problem is, i'm very new to javascript!! :)
ptamzz
If you want to use jQuery, this may help: http://jqueryui.com/demos/slider/
Delan Azabani
Thank you very much. I'll see what I can do with that. :)
ptamzz
Hello, can you help me with this?? Is there some event like "onCurrentTimeChange"??What I want to do is, as the audio plays on, I want to trigger an event and reset the seeker position through something like function setSeekerPosition() {seekbar.value = audio.currentTime;}audio.onCurrentTimeChange = setSeekerPosition;If I'm totally wrong, please redirect me!!
ptamzz
There is a "timeupdate" event that you can add a function listener to. https://developer.mozilla.org/en/using_audio_and_video_in_firefox
Delan Azabani