如何使用 JWPlayer 5.4 查找()然后暂停()
有谁知道如何让 JW PLayer v5.4(Flash 渲染或 HTML5 渲染)在执行eek()命令后暂停?
当用户单击细粒度控制按钮(或使用向左或向右箭头键)时,我试图让视频向前或向后步进 0.01 秒。这样他们就可以更精确地捕捉帧抓取。
我不确定这是否可能,但我尝试了一些方法但没有运气。比如下面的:
var stepTo = jwplayer("video_player").getPosition() + 0.01;
jwplayer("video_player").seek(stepTo).onComplete(function(){
jwplayer('video_player').pause();
});
And:
jwplayer("video_player").pause().seek(stepTo);
And:
jwplayer("jwplayer_container").seek(stepTo).pause();
And:
jwplayer("video_player").pause().play().pause();
我也看到'Shortcuts'插件有这个功能,但是那个插件还不兼容v5.4。
感谢您的任何帮助。
Does anyone know how to get JW PLayer v5.4 (either the Flash rendering or the HTML5 rendering) to pause after a seek() command?
I'm trying to get the video to step 0.01 seconds forward or backward when a user clicks the fine-grain control buttons (or uses the left or right arrow keys). This is so they can snap a framegrab with better precision.
I'm not sure if this is even possible but I've tried a few things with no luck. Such as the following:
var stepTo = jwplayer("video_player").getPosition() + 0.01;
jwplayer("video_player").seek(stepTo).onComplete(function(){
jwplayer('video_player').pause();
});
And:
jwplayer("video_player").pause().seek(stepTo);
And:
jwplayer("jwplayer_container").seek(stepTo).pause();
And:
jwplayer("video_player").pause().play().pause();
I've also seen that the 'Shortcuts' plugin has this feature, but that plugin ins't compatible with v5.4 yet.
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
@AJB -
有一张票来添加为 5.6 播放器安排的“onSeek”活动。同时,最好的方法可能是这样的:
如果 onTime() 事件在查找完成之前触发,您可以通过在定义 onTime() 处理程序之前设置超时来绕过它。
@AJB -
There's a ticket to add an "onSeek" event scheduled for the 5.6 player. In the meantime, the best way to do this is probably something like this:
If the onTime() event fires off before the seek is complete, you may be able to hack around it by setting a timeout before defining the onTime() handler.
使用 JW Player 6,您可以执行以下操作以使视频在搜索后暂停:
With JW Player 6, you can do the following to cause the video to pause after seeking:
这是 PabloS 代码的一个小变化:
我必须编写更改源媒体文件的代码,而无需从头开始播放视频。我想在暂停时处理视频切换。当我在
onSeek
回调中使用seek
和pause
时,它不起作用,因为视频仍在缓冲。像上面的代码一样在onTime
回调中暂停就像一个魅力。This is a little variation on PabloS code:
I had to write code that changed source mediafile without starting video from the beginning. I wanted to handle switching video when it was paused. When I used
seek
andpause
inonSeek
callback it didn't work because video was still buffering. Pausing inonTime
callback like in code above worked like a charm.