问题描述
< video> 标记属性 webkit-playsinline 据说可以防止默认转到HTML5视频的全屏行为。
我将此属性添加到了我的视频标签,并在iOS6 iPhone上检查了移动Safari和Chrome,但它不起作用。视频仍然全屏显示。
截至2013年6月13日,今天的移动浏览器的属性 webkit-playsinline work?
Apple终于启用了 playsinline 属性在iOS 10上,所以这将工作:
< video src =file.mp4 playsinline>
我写了一个叫做,它为iOS 8和9增加了相同的行为。
The <video> tag attribute webkit-playsinline supposedly prevents the default go to fullscreen behavior of HTML5 videos.
I added this attribute to my video tag and checked mobile safari and chrome on iOS6 iPhone and it doesn't work. The video still goes fullscreen. This is similar to others' experiences as described on SO two years ago.
What mobile browsers as of today, June 13th, 2013 does this attribute webkit-playsinline work?
Apple has finally enabled the playsinline attribute on iOS 10, so this will work:
<video src="file.mp4" playsinline>
I wrote a polyfill called iphone-inline-video that adds the same behavior to iOS 8 and 9.
这篇关于" WebKit的playsinline"视频标签属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!