删除iPad的HTML5视频“控件” [英] Removing HTML5 video 'Controls' for iPad

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

问题描述

我发现HTML5视频属性中不包含控件。

I've discovered when NOT including 'Controls' within the HTML5 video attribute.

iPad不会播放视频。

The iPad will not play the video.

如何删除HTML5视频控件;同时仍允许视频正常运行;在iPad iOS上。

How do I remove the HTML5 video controls; while still allowing the video to function normally; on iPad iOS.

注意://我可以以某种方式删除脚本中的控件;同时在HTML5视频标记内保持一致;这可能是一个可行的解决方案吗?

Note: // Could I somehow remove 'Controls' with a script; while keeping it in tact within the HTML5 video mark-up; could this be a viable solution?

推荐答案

用户需要控件才能与视频互动,否则他们怎么玩它,暂停等等。

The user needs controls to be able to interact with the video, otherwise how can they play it, pause it etc.?

您可以使用JavaScript删除控件但效果相同,即用户无法控制视频。

You can remove the controls with JavaScript but it would have the same effect, i.e. the user unable to control the video.

因此,您需要将控件保留,或隐藏它们并使用Media API构建您自己的集合(请参阅使用HTML5多媒体组件 - 第3部分:自定义控件)。这样你就可以限制控件了。例如。

So you need to either leave the control in, or hide them and build your own set using the Media API (see Working with HTML5 multimedia components – Part 3: Custom controls ). This way you could limit the controls for example.

如果你只是想让用户在点击它时播放视频,你可以试试像:

If you want to simply allow the user to play the video when they "click" on it, you could try something like:

var video = document.getElementById('myVideoId');
video.addEventListener('click', function() { video.play(); }, false);

这篇关于删除iPad的HTML5视频“控件”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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