facebook

Audio Widget – Do Something After Playing

  1. MobiOne Archive
  2.  > 
  3. Examples, HOW-TOs
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #334953 Reply

    Brandon
    Member

    This is the code you will need to do something when the media you set is finished playing. I know Support is working on a doc but it was greatly needed for my music player.

    Here we go:

    
    
    //Set our media to an mp3 file
    $("#m1-wmms-audio1-player").jPlayer("setMedia", { mp3: "http://fileurlstring.mp3" });
    //Play our media
    $("#m1-wmms-audio1-player").jPlayer("play");
    
    //Set an on ended event using the jQuery bind
     $("#m1-wmms-audio1-player").bind($.jPlayer.event.ended + ".jp-repeat", function(event) { // Using ".jp-repeat" namespace so we can easily remove this event
    
       //On Ended do this
    alert("Song Has Ended");
    
      });
    
    

    Enjoy!

    #342795 Reply

    Muhammad
    Member

    I used this code but nothing happen after sound finished playing.
    is there change already?

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Audio Widget – Do Something After Playing

You must be logged in to post in the forum log in