HTML5 Audio - Progress Bar

I am trying to create an MP3 player in HTML5. Almost all the work is done, but I need me to replace the default controls from the tag <audio>and create my own controls. Simple controls such as play, pause, stop and volume, but I want to create a progress bar that tracks the duration of audio / MP 3 when a specific position on the track goes when you click on the corresponding position. As in the following example.

http://msdn.microsoft.com/en-us/library/ie/gg589528(v=vs.85).aspx

The thing is, in the above example, the / MP 3 file is already loaded, and I actually create an audio element using document.createElement("audio");

When I tried to use different ways to modify the above example, I basically get the error message "cannot call addeventlistener from null". I want this player to run in Chrome.

Thank you in advance for your support and help.

+5
source share
1 answer

This tutorial, which I wrote a while ago, shows an example implementation: Working with HTML5 multimedia components. Part 3. User controls . Calls, etc. Must be the same for a dynamically created item audio.

But yes, some code examples of what you are doing would be helpful.

+2
source

All Articles