" WebKit的playsinline"视频标签属性 [英] "webkit-playsinline" video tag attribute

查看:532
本文介绍了" WebKit的playsinline"视频标签属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< video> 标记属性 webkit-playsinline 据说可以防止默认转到HTML5视频的全屏行为。

我将此属性添加到了我的视频标签,并在iOS6 iPhone上检查了移动Safari和Chrome,但它不起作用。视频仍然全屏显示。 这类似于其他人在两年前所述的体验。



截至2013年6月13日,今天的移动浏览器的属性 webkit-playsinline work?

解决方案

Apple终于启用了 playsinline 属性在iOS 10上,所以这将工作:

 < video src =file.mp4 playsinline> 

我写了一个叫做 iphone-inline-video ,它为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.

这篇关于&QUOT; WebKit的playsinline&QUOT;视频标签属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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