在iPad上寻找HTML5视频 [英] HTML5 video seeking on iPad

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

问题描述

我有一个带有自定义搜索栏的HTML5视频播放器,它可以在iPhone上播放(在线播放)和浏览器。

I have an HTML5 video player with a custom seek bar, that's working great on the iPhone (playing inline) and on the browser.

它在iPad也会随着电影播放而更新搜索栏,但出于某种原因,我无法寻找。

It plays great on the iPad too and the seek bar is updated as the movie plays, but for some reason, I can't seek.

所有值都是正确的我正在尝试设置:

All of the values are correct and I'm trying to set:

myPlayer.currentTime = XX;

不幸的是,iPad拒绝设置.currentTime属性。

Unfortunately, the iPad refuses to set the .currentTime attribute.

我可以收集浏览器和iPad之间的差异是我在浏览器上的

From what I can gather the difference between the browser and iPad is that on the browser I get:

myPlayer.networkState = 3
myPlayer.readyState = 4

在iPad上我得到:

myPlayer.networkState = 2
myPlayer.readyState = 3

这是完全相同的代码,运行本地MP4视频。

It's exactly the same code, running a local MP4 video.

知道为什么会这样吗?

干杯,
Andre

Cheers, Andre

推荐答案

我遇到了各种让JavaScript控制音频元素的问题,以及对currentTime属性的很多挫折,以及Apple对构成内容的限制直接用户启动活动。

I've had all kinds of problems getting JavaScript to control audio elements, and a lot of frustration with the currentTime property, along with Apple's restrictions on what constitutes direct user initiation of events.

如果有的话,我不会感到惊讶一种奇怪的错误与JavaScript& iPad上的HTML5视频播放(或未记录的功能),需要一种解决方法。根据我的经验,iPad有一种独特的处理方式,而不是官方文档中的内容。

It wouldn't surprise me if there were some kind of weird bug with JavaScript & HTML5 video playback on the iPad (or "feature" that's undocumented), which requires a workaround. From my experience, the iPad has a unique way of doing things than what's in the official documentation.

你应该检查错误缓冲可搜索,以及寻找视频元素的属性。看看你的readyState& netState值,iPad似乎认为视频尚未完全加载 - 这对于本地资源来说是奇怪的。

You should check the error, buffered, seekable, and seeking properties of the video element. Looking at your readyState & networkState values, the iPad seems to think that the video has not been completely loaded - which is odd for a local resource.

缓冲可搜索应该等于整个视频的时间范围。寻求应该是真的。这应该至少可以为您提供有关该问题的更多信息。

buffered and seekable should be equal to the time range of your entire video. seeking should be TRUE. That should at least give you a little more information about the problem.

您是否已使用其他视频进行过测试? 可能是因为iPad出现问题的视频存在某种编码问题。

Have you tested it with other videos? It might be that there is some kind of encoding problem with the video that the iPad has a problem with.

除此之外 - 还有之前的iPad OS版本中的一个错误破坏了设置currentTime属性的能力。您使用的是最新的操作系统版本吗?

Other than that - there was a bug in a previous iPad OS version that broke the ability to set the currentTime property. Are you using the latest OS version?

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

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