在iPad上播放HTML5视频并寻找(Playing HTML5 Video on IPad and seeking)
非常奇怪的错误,我似乎无法弄清楚。
我试图在用户点击播放时从某个特定位置播放HTML5视频。 我试图在视频开始播放时寻求正确的方式。
在我的播放事件中,我做了this.currentTime = X
在浏览器上它工作正常。 但在iPad上,当我播放视频时,视频无法找到正确的位置(从零开始)。
更奇怪的是,如果我在setTimeout中做this.currentTime = X调用,比如说1秒,它就可以在IPad上工作(有时候)。
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).
原文:https://stackoverflow.com/questions/11252062
更新时间:2019-11-01 19:49
相关问答
对, 我和这个没有任何关系,并向苹果提出了一个错误。 几周后,他们回到我说,很简单,我应该添加“webkit -playinline”到HTML上的视频标签,以及在UIWebView中添加“allowedInlineMediaPlayback”属性。 所以最后,这就是它的样子: HTML
OBJ-C webview.allowsInlineMediaPlayback =
...
这里 DEMO var vids = {
vid1:"http://www.youtube.com/embed/87O_YA4rLyk",
vid2:"http://www.youtube.com/embed/nQ2TsPhsWTA"
}
$(function(e) {
$(".video-section ul li").click(function(e) {
$(this).hide();
$(this).siblings().show();
...
听起来这可能是一个路径问题。 您正在为视频使用相对路径名,因此它们需要位于HTML预期的位置才能找到它们。 您需要将绝对路径名用于包中的文件,或者确保将基础href定义为指向保存这些图像的适当文件夹(显式地在HTML中或通过在loadHTMLString中指定正确的baseref):baseURL :打电话。 快速测试这是否有问题的一种方法是将视频文件旁边的.png放在HTML中,并将其引用到HTML中。 如果.png没有显示出来,那么这不是视频问题,而是寻找资产的问题。 Sounds like
...
由于某些原因,除非您设置controls =“true”标志,否则视频无法在iPad上播放。 For some reason videos would not play on iPad unless you set the controls="true" flag.
您是否尝试过重命名视频以进行ogg扩展? I broke down and converted the files to M4V and it's working fine.
这可能与我遇到的问题相同。 将controls属性添加到视频标记时,视频标记将捕获所有事件。尝试删除controls属性... This may be the same problem I had. The video tag will capture all the events when the controls attribute is added to the video tag.. Try removing the controls attribute...
请参阅我的问题,根据HTML 5在移动游猎。 似乎无法控制它,因为视频渲染通过浏览器委托给硬件,并显示在“上方”,因此控制它的css属性不会影响任何东西。 我的研究在一段时间之前,但不要以为从那以后发生了一些变化。 Please refer to my question according HTML 5 on mobile safari. Seems that it's impossible to control it, as video rendering is delegated to har
...
使用绝对路径而不是相对路径尝试相同的代码:
src="http://cdn.kaltura.org/apis/html5lib/kplayer-examples/media/bbb_trailer_iphone.m4v"
poster="http://cdn.kaltura.org/apis/html5lib/kplayer-examples/media/bbb480.jpg"
durationHint="
...
坏消息抱歉...迄今为止webkitEnterFullscreen不支持iPad。 好消息是规格已在这里草稿: http : //dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html 我们需要等一会儿才会发生...... So after painstakingly tedious debugging i discovered the cause of my problem. I went through all my css rules tha
...
不会。最终您可以使用getUserMedia / Stream API执行此操作,但iOS Safari目前不支持此功能。 No. Eventually you will be able to do this using the getUserMedia / Stream API but this is not currently supported on iOS Safari.