Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to 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 any way to disable the autoplay?

like image 900
Mr_Nizzle Avatar asked Nov 23 '25 14:11

Mr_Nizzle


2 Answers

Remove .jPlayer("play")

like image 116
Dominic Barnes Avatar answered Nov 26 '25 03:11

Dominic Barnes


how about reading the manual:

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

to disable looping (repeat) i would try:

$("#jpId").jPlayer("onSoundComplete", function() {
  // Directly access this instance's jPlayer methods. (Does not support chaining.)
  this.stop(); 
});
like image 22
mkoryak Avatar answered Nov 26 '25 04:11

mkoryak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!