我在网页中嵌入了视频。 我想让它在 iOS 上内联播放,而不是在单击播放按钮时扩展到全屏。
我试过了
添加 webkit-playsinline
<video width="400" controls webkit-playsinline>
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
我试过在 JSFiddle 中添加<-- 请使用您的手机/平板电脑查看它
有什么提示吗?
最佳答案
您还必须在 Obj C 中设置以下内容。
webview.allowsInlineMediaPlayback = YES;
您现有的属性如下所示。
<video id="player" width="480" height="320" webkit-playsinline>
其他 - 使用 HTML5 FullScreen API
http://www.sitepoint.com/use-html5-full-screen-api/
https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API
下面是 Webkit Fullscreen 的属性。
- document.webkitCurrentFullScreenElement
- document.webkitCancelFullScreen
- document.webkitFullScreenKeyboardInputAllowed
- document.webkitIsFullScreen
关于javascript - 内联显示视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34323888/