uni-app视频默认全屏播放
2021/02/02 标签:
uni-app
在做小程序时,遇到播放视频,希望直接点击视频便全屏播放,uniapp 文档上也有介绍createvideocontext
this.videoContext = uni.createVideoContext(id,this); this.videoContext.requestFullScreen();
<video id="myVideo" :src="videoUrl" @fullscreenchange="fullscreenchange"></video>
退出全屏时,停止播放
fullscreenchange (e){ if(!e.detail.fullScreen){ this.videoContext.stop() }}
上一篇:
JS取出两个数组中的不同或相同元素
下一篇:
deepMerge深合并代码对比