iOS HTML5 视频播放器下一个/上一个按钮
有没有办法访问/收听 iOS HTML5 视频播放器中的上一个/下一个按钮?理想情况下,我会收听某种上一个和下一个事件,并相应地交换视频,而无需用户关闭视频并单击我的上一个/下一个按钮。
(来源:iphonefaq.org)
我目前正在使用 jwplayer 生成 html5 视频,并且收听他们的播放列表下一个/上一个侦听器似乎并不能解决问题。不过,我总是可以轻松地找到侦听器并将其附加到实际的 标记。
Is there a way to access/listen to the previous/next buttons in the iOS HTML5 video player? Ideally I would listen to some sort of a prev and next event and swap out the videos accordingly without the user having to close the video and click my prev/next buttons.
(source: iphonefaq.org)
I am currently using jwplayer to generate the html5 video and listening to their playlist next/prev listeners don't seem to do the trick. I can always find and attach listeners to the actual <video>
tag pretty easily though.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您将侦听器附加到视频标签本身,那么当用户点击下一个和上一个时,代码中的侦听器将放在这些按钮上。我正在对 youTube 视频做类似的事情。如果您点击“下一个”,它会转到 YouTube 视频的末尾并触发一个视频完成事件标记,然后我会在调用下一个视频时加载下一个视频,这样视频将在没有“下一个”按钮的情况下循环播放,并且用户可以点击两个按钮。我还没有找到一种方法来监控 iPhone 端播放器中的按钮,但如果我找到了,我也会发布它,因为如果可能的话,了解这两个天使是很重要的。
有趣的是,我想我正在尝试做同样的事情。我知道如何将视频转换到下一个视频,而不必离开全屏模式,因为在 js 中使用了 youTube api,但我无法观察 Quicktime 播放器本身,并且需要我想要开发的另一个功能。
If you attach listeners to the video tag itself then when the user hits next and previous then the listeners in the code will put up on those buttons. I am doing something similar with youTube videos. If you hit next it goes to the end of the youtube video and fires a video complete event tag and then I load the next video when that is called, so that the video will one loop without the next button and two the users can hit the buttons. I have not found a way to monitor the buttons in the player on the iphone side, but if I find it I will post that as well since it is important to know both angels if possible.
Funny thing I think I am looking to try and do the same exact thing. I know how to transition the videos to the next without having to leave the fullscreen mode because of using youTube api in the js but I am not able to observe the quicktime player itself and need to for another feature that I would like to work on.
这是原生 iOS 播放器,是 Quicktime 的精简版。当它没有从 Quicktime 播放器和 Safari 中的页面转换时,您就会知道它是否是 HTML5 播放器。您的电影是如何嵌入的?
That's the native iOS player which is a thin version of Quicktime. You'll know if it's an HTML5 player when it doesn't transition from the Quicktime player and your page in Safari. How is your movie being embedded?
我最近遇到了类似的问题,但无法使用 HTML 播放器找到解决方案。我最终使用 MPVideoPlayer Framework 实现了视频播放器,并使用自定义 URL 方案 (AppName:Commnad:Asset) 从我的 Web 视图启动它。然后我就能够使用委托方法来监视用户交互。如果您想查看基本实现,请告诉我,我可以添加一些代码。
I recently had a similar problem and was unable to find a solution using the HTML player. I ended up implementing the video player using MPVideoPlayer Framework and launching it from my web view with a custom URL scheme (AppName:Commnad:Asset). I was then able to use the delegate methods to monitor user interactions. If you would like to see basic implementation, let me know and I can add some code.