Search code examples
javascriptjqueryaudiojplayer

jPlayer - set to play once and only once


I've been searching for the best way to get a jPlayer instance to allow an audio file to only be played once. I think I could call .jPlayer("destroy"); after the event is completed, but I feel like there must be a better way.


Solution

  • $(id).jPlayer( "clearMedia" ) : jQuery
    

    You can use this to clear your current media after playing one song. After that play button wont play anything untill you use new url by using setmedia method