How do I disable jQuery.jplayer autoplay?

when i initialize the player like this:


$("#jquery_jplayer").jPlayer({
        ready: function () {
            this.element.jPlayer("setFile", "/previews/cancion.mp3", "/previews/horse.ogg").jPlayer("play");
        },
        volume: 50,
        oggSupport: true
    })

      


Is there a way to turn off autoplay?

+2


a source to share


3 answers


Delete .jPlayer("play")



+7


a source


how about reading the manual:

http://www.happyworm.com/jquery/jplayer/latest/developer-guide.htm



to turn off the loop (repeat) I would try:

$("#jpId").jPlayer("onSoundComplete", function() {
  // Directly access this instance jPlayer methods. (Does not support chaining.)
  this.stop(); 
});

      

+1


a source


.jPlayer("pause");

      

What is it. This worked for my project. Place this at the end of the function that plays the song. Not a function that loads jplayer, but a track selection function.

Cheers to those looking at this in 6-7 years. :) Others have helped me arrive at this simple, compelling solution.

+1


a source







All Articles