Saturngod

What's on my mind

HTML5 audio with javascript

Create audioElement

var audioElement = document.createElement('audio');

want to use with current audio tag

var audioElement = document.getElementById('myaudio');

Play

audioElement.play();

Pause

audioElement.pause();

Stop

audioElement.pause();
audioElement.currentTime = 0;

Duration (show with seconds)

audioElement.duration

Current Time (seconds)

audioElement.currentTime

Go to 35 secons

audioElement.currentTime = 35;

Change music

audioElement.setAttribute('src', 'music/Track01.mp3'); audioElement.load();

Ogg for firefox and opera. Mp3 for safari and chrome.

html audio with jquery UI

I need to implement , next , previous and change to another music when music has been stop.

Source http://github.com/saturngod/html5audio-jquery_ui

Demo http://www.saturngod.net/project/html5audio/