JWPlayer 防止向前跳,除非已经看过
我正在使用 JWPlayer 5.4,它是使用 javascript API 在页面上设置的。
我想做的是,只有当用户已经播放过视频的该部分时,他们才能通过搜索栏快进/后退。
因此,如果用户是第一次观看视频,他们无法跳过当前位置,但他们可以在视频播放的位置前后搜索。
我正在努力解决 API onTime 事件等问题,尝试计算出数学公式来完成这项工作。
有谁知道如何做到这一点。
谢谢
I'm using JWPlayer 5.4 and it's setup on the page using the javascript API.
What I'd like to do is make it so that users can fastforward/rewing via the seek bar ONLY if they have already played that part of the video.
So, if a user is watching the video for the first time they can't skip beyond the current position, however they can seek forward and back behind where the video played up until.
I'm struggling with the API onTime events etc. to try and work out the Math to make this work.
Does anyone know how this could be done.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不久前发现了这个,可能是在 JWplayer 论坛上。我想我添加了一些关于播放列表的内容。
因此,以防万一您或其他人仍在寻找答案,请考虑添加以下内容:
I found this a while back, probably on the JWplayer forum. I think I added a bit about the playlist.
So just in case you or others are still looking for an answer, consider adding stuff like:
使用 @mal 的答案已经有一段时间了,但发现它在某些边缘情况下(例如单击和拖动)出现问题。可能是因为我们使用的是 JW 播放器 8?
不管怎样,如果有人仍在寻找这个问题的答案,得到了一个修改后的解决方案,可以很好地涵盖它们。依赖于 seeked 处理程序,该处理程序在发生寻道。
Had been using @mal's answer for a while, but found it was breaking for some edge cases (e.g. click and drag). Could be because we're on JW player 8?
Anyway, got a modified solution that covers them pretty well if anyone is still looking for answers to this. Relies on the seeked handler which fires after the seek occurs.
这对我有用
Here's what worked for me