Reputation: 1030
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.
Upvotes: 3
Views: 2431
Reputation: 30416
I'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.
Upvotes: 7
Reputation: 31
Just do this before you instance jPlayer:
$.jPlayer.prototype.seekBar = function() {};
Upvotes: 3
Reputation: 1890
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.org/latest/quick-start-guide/event-ended/
Good luck!
Upvotes: 1