I need to stop all other instances of jPlayer before playing a new one when i click play.
Thanks for you help.
SOLVED
just assigned onclick function to the play trigger and the functions does:
function stopall(){
$(".jplyrselectr").jPlayer("stop");
}
Give all of your players a class (I think default is class="jp-jplayer"), then include the following "play" event handler in your initialisation options:
$("#jplayer1").jPlayer({
ready: function() {
$(this).jPlayer("setMedia", {
mp3: "mp3/track1.mp3"
});
},
play: function() {
$(".jp-jplayer").not(this).jPlayer("stop");
},
swfPath: "js",
wmode: "window"
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With