html5 - 如何让H5 video标签在移动端,不默认全屏播放。
巴扎黑
巴扎黑 2017-04-17 12:06:22
0
3
844

如何让H5 video标签在移动端,不默认全屏播放。

参考美拍,优酷,微视等移动端H5页面。他们皆可不全屏播放video。

!!!不要跟我说

可以在 video 标签上加一个 “webkit-playsinline” 属性

很明显这是不可以实现的,不管是Ios还是安卓都一样还是照旧全屏播放

求大神,求大牛解答

巴扎黑
巴扎黑

reply all(3)
阿神

To add the reason for this problem:
The operation of VIDEO browsed by each mobile phone is different.
iphone Unless the page itself is an apology page within the APP, with the APP's own operation of H5 webview, the video playback can be realized without full screen

Starts from andriod 6.0 or above. Xiaomi mobile phones, etc., will start to default to the video tag. Will not play in full screen by default.

So click here.

Thank you both for your answers

黄舟

x-webkit-airplay="true"
webkit-playsinline="true"
Write it like this and try it!

Ty80

webkit-playsinline="true" must be used in conjunction with the application's internal API. It is meaningless to use it alone. http://stackoverflow.com/questions/3699552/html5-inline-video-on-iphone-vs-ipad-browser

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!