我可以在 iPhone / iPad 上为 HTML5 视频换肤吗?
我看过很多关于如何为桌面浏览器设置 html5 视频外观的教程,但找不到任何与在 iPad / iPhone 上设置 html5 相关的内容。
我假设这是因为它无法完成。
有人帮我在这下面画一条线吗?
谢谢!
I've seen lots of tutorials on how to skin html5 video for desktop browsers, but can't find anything relating to skinning the html5 <video>
on an iPad / iPhone.
I'm assuming that this is because it can't be done.
Anyone draw a line under this for me?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您实际上可以为它们换肤,但存在限制,这就是为什么您会看到大多数 HTML5 视频播放器 仅使用内置控制器。
例如,您无法通过 JavaScript 在 iPad 上触发全屏模式。因此,您无法在 HTML 中构建将触发它的自定义按钮。您只能通过内置控制器(或反向捏合)来完成此操作。这是移动 Safari 的一个不幸的限制。
此外,一旦进入本机全屏模式(浏览器或移动设备),默认控件无论如何都会接管。因此,对于总是全屏播放的 iPhone 来说,拥有自定义控件实际上没有任何好处。
Mozilla (Firefox) 实际上采用的方法是开发人员可以将页面上的任何元素扩展到全屏。这意味着自定义控件即使在全屏模式下也可以保留。我真的很欣赏这个方向。我还没有检查这是否适用于 FF4,但这显然是计划。
You can actually skin them, but there's limitations, which is why you'll see most HTML5 video players just use the built in controller.
For instance, you can't trigger fullscreen mode on the iPad through javascript. So you can't build a custom button in HTML that will trigger it. You can only do it through the built in controller (or a reverse pinch). It's an unfortunate limitation of mobile Safari.
Also, once in native fullscreen mode (browser or mobile device) the default controls take over anyway. So in the case of the iPhone, which always plays in fullscreen, there's really no benefit to having custom controls.
Mozilla (Firefox) is actually taking the approach where developers can make any element on the page expand to fullscreen. This means custom controls can persist even in fullscreen mode. I really appreciate this direction. I haven't checked if that works in FF4 yet, but that's apparently the plan.
您读到的有关 html5 视频换肤的所有内容都适用于 iPad/iPhone。
元素在由 Webkit 引擎(Chrome、Safari)呈现的
UIWebView
中启动Everything you read about skinning html5 videos is valid for iPad/iPhone. The
<video>
element is launched in aUIWebView
which is rendered by the Webkit engine (Chrome, Safari)