在iPad上播放HTML5视频并寻找 [英] Playing HTML5 Video on IPad and seeking

查看:142
本文介绍了在iPad上播放HTML5视频并寻找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图在用户点击播放时从某个特定位置播放HTML5视频。我试图让它在视频开始播放时寻求正确。



在我的比赛中,我做了 this.currentTime = X



在浏览器中,它工作正常。但在iPad上,当我播放视频时,视频不会找到正确的位置(从零开始)。

更甚奇怪的是,如果我做 this.currentTime = X 在一个setTimeout中调用,比如说1秒,它可以在IPad上工作(有时候)。

解决方案

欣赏以下答案。不幸的是,如果当前时间> 0且不得不求助于内部时间更新, 1,如果它然后转到视频的那一部分并删除了听众的timeupdate。


Very strange bug I can't seems to figure out.

I am trying to get an HTML5 video to play from a certain position when a user hits play. I am trying to have it seek right when the video starts to play.

On my play event I do this.currentTime = X

On the browser it works fine. But on the IPad, when I play the video, the video doesn't seek to the right position (it starts from zero).

Even more oddly, if I do the this.currentTime = X call in a setTimeout of let's say 1 second, it works on the IPad (sometimes).

解决方案

Appreciate the attempts for answers below. Unfortunately, had to resort to just checking inside timeupdate if the currenttime was > 0 and < 1, if it was then went to that part of the video and removed the listener to timeupdate.

这篇关于在iPad上播放HTML5视频并寻找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆