最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Removing seeking in jPlayer - Stack Overflow

programmeradmin2浏览0评论

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 badges
Add a ment  | 

3 Answers 3

Reset to default 7

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.

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!

发布评论

评论列表(0)

  1. 暂无评论