Home > Web Front-end > H5 Tutorial > body text

如何禁止 iPhone Safari 视频自动全屏?

WBOY
Release: 2016-06-07 08:43:53
Original
6598 people have browsed it


由JavaScript控制播放 不使用video标签controls属性
iPhone safari 点击视频会弹出播放器进行全屏播放
如何不全屏 使视频在网页中播放?

回复内容:

iPhone Safari 中播放视频只能全屏,所以这个问题是没有答案的。
-------------------------------------
以下为拓展,
在iOS APP中使用网页视频,是可以禁止全屏播放的,方法如下:
  1. 前端将video标签加入属性 webkit-playsinline,如:
  2. Obj-C中,添加配置:webview.allowsInlineMediaPlayback = YES;
这样web视频就可以嵌入播放了,方案参考:
HTML5 inline video on iPhone vs iPad/Browser 可以在 video 标签上加一个 “webkit-playsinline” 属性 ,如下:

详情参见官方文档: UIWebView Class Reference iPhone Safari 只能全屏播放视频。 IOS APP可以使用
<code class="language-text"><video id="video" width="280" height="140" webkit-playsinline></video>
</code>
Copy after login
补充一个 IOS Safari 实现内联播放的方法 > 用這種方法必須要把web用objectC包起來才行
不知道有沒有純web的方法來達到iphone播放視頻不全螢幕? 把视频转码,用ajax去分段请求数据来填充到canvas。
不过现在还没找到完美的办法,这个是算是曲线救国。
同求完美的解决方案
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!