Javascript shim for HTML5 Audio Issues

I am using a javascript shim called audio.js to deliver HTML5 sound with flash backup. I work now in all modern browsers, both Android and iOs, but there is one problem that I just can’t fix, and that in Firefox or Android, when I use the callback launched at the end of the track, I can’t play audio . The file is stuck at the end of playback.

The project is a slide show whose logic depends on callbacks that start when each track ends. This is how I try to use the callback:

audio.trackEnded=function() {

    // operate on the DOM
    }

and here is a bit from the audio.js API:

trackEnded: function(e) {
      this.skipTo.apply(this, [0]);
      if (!this.settings.loop) this.pause.apply(this);
      this.settings.trackEnded.apply(this);
    }

API, , reset . , , , , trackEnded, , , , , . , currentTime = 0; .

, -:

http://www.jontakiff.com/audio-playback/skeleton.html

, , .

: API audio.js: http://kolber.github.com/audiojs/docs/

+3
1

, . jQuery Connect. :

http://beyondrelational.com/modules/2/blogs/61/posts/11231/what-is-jquery-connect-how-to-use-jquery-connect.aspx

http://archive.plugins.jquery.com/project/jqConnect

jquery :

$.connect(audio,'trackEnded',window,window.trackEnded);

, trackEnded :

function trackEnded(){
    //code here
}
0

All Articles