微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

有没有办法使HTML5视频全屏?

有没有办法使用HTML5< video>标签

如果这是不可能的,有谁知道这个决定是否有理由?

解决方法

HTML 5没有提供使视频全屏的方法,但是并行 Fullscreen specification提供requestFullScreen方法,该方法允许任意元素(包括< video>元素)全屏显示

它有experimental support in a number of browsers

原始答案:

HTML5 spec(写作时:09年6月):

User agents should not provide a
public API to cause videos to be shown
full-screen. A script,combined with a
carefully crafted video file,Could
trick the user into thinking a
system-modal dialog had been shown,
and prompt the user for a password.
There is also the danger of “mere”
annoyance,with pages launching
full-screen videos when links are
clicked or pages navigated. Instead,
user-agent specific interface features
may be provided to easily allow the
user to obtain a full-screen playback
mode.

浏览器可以提供用户界面,但不应提供可编程的。

请注意,上述警告已从规范中删除

原文地址:https://www.jb51.cc/html5/170414.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。