views:

94

answers:

0

Hi,

I'm using a jQuery plugin (http://www.soltanrezaey.com/bssound/demo.html) to add very basic audio-playing capabilities to a web page. The plugin works by creating an 'embed' element (I know, I know...), setting its src to the audio file, setting the autoplay attribute to true and appending it to the page.

Despite the use of the deprecated embed element it works very well cross-browser and is very simple. Plus it was the only one I could find that doesn't use flash.

I'd like to continue using it, but there's just one problem - there is a delay between the embed element being added to the page and the audio clip beginning to play. Is there any way to tell when the audio clip has started playing programmatically?

I tired using the onLoad event, which theoretically shouldn't be fired until the audio clip and therefore the embed element has finished loading, but the event is fired as soon as the embed is added to the page...

Any ideas?