1.在微信中禁止全屏
在VIDEO标签中增加 x5-video-player-type=“h5-page” x5-video-orientation=“landscape|portrait”

<video x5-video-player-type="h5-page" x5-video-orientation="landscape|portrait">
	<source src="1.mp4" type="video/mp4"></source>
</video>

2.在IOS浏览中禁止全屏
在VIDEO标签中增加 webkit-playsinline=“true” playsinline=“true”

<video x5-video-player-type="h5-page" x5-video-orientation="landscape|portrait" webkit-playsinline="true" playsinline="true">
	<source src="1.mp4" type="video/mp4"></source>
</video>
<video 
  id="video"  
  src="cuplayer.mp4"  
  poster="images/cuplayer.jpg"  
  preload="auto"  
  webkit-playsinline="true" /*这个属性是ios 10中设置可以让视频在小窗内播放,也就是不是全屏播放*/   
  playsinline="true"  /*IOS微信浏览器支持小窗内播放*/  
  x-webkit-airplay="allow"  
  x5-video-player-type="h5"  /*启用H5播放器,是wechat安卓版特性*/ 
  x5-video-player-fullscreen="true" /*全屏设置,设置为 true 是防止横屏*/> 
  x5-video-orientation="portraint" /*播放器支付的方向,landscape横屏,portraint竖屏,默认值为竖屏*/ 
  style="object-fit:fill"> 
</video> 
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐