I'm making an application using jPlayer and I would like to keep most of the default functionality. The playing works fine except that I would like to disable seeking, i.e., the progress bar is displayed but clicking it does not take you to any other point in the song. I've tried:
$('#jquery_jplayer_1').unbind($.jPlayer.event.seeking);
but it doesn't seem to work.
Any help would be nice.
I'm making an application using jPlayer and I would like to keep most of the default functionality. The playing works fine except that I would like to disable seeking, i.e., the progress bar is displayed but clicking it does not take you to any other point in the song. I've tried:
$('#jquery_jplayer_1').unbind($.jPlayer.event.seeking);
but it doesn't seem to work.
Any help would be nice.
Share Improve this question edited Nov 29, 2021 at 23:19 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Aug 31, 2011 at 9:06 Catherine HwangCatherine Hwang 1,0303 gold badges10 silver badges18 bronze badges3 Answers
Reset to default 7I've done this on my site, and it is really easy. Just don't include an element for the seek bar. Instead of this:
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
Just do this:
<div class="jp-progress">
<div class="jp-play-bar"></div>
</div>
The play-bar will still work, but there will be no seek-bar.
Just do this before you instance jPlayer:
$.jPlayer.prototype.seekBar = function() {};
I'm not too familiar with jPlayer, but I'd start by making sure '$.jPlayer.event.seeking' returns a string, and not an event object; unbind()
takes a string as it's argument. If that doesn't work, you can try listening for the seeking event, log the event object passed to that function, and get the name from there (to use with unbind()
).
If that fails, here's a guy who's customized jPlayer and looks like he's unbinded some events: http://www.jplayer/latest/quick-start-guide/event-ended/
Good luck!