How do I handle the seek bar using javascript in HTML5 audio tag?
-
30-09-2019 - |
Question
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?
Solution
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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow