<video
:src="url"
controls
id="videoId"
@play="play"
@fullscreenchange="fullscreenchange">
</video>
// 播放时进入全屏 play(index) { let videoContext = uni.createVideoContext('videoId', this) videoContext.requestFullScreen() }, //退出全屏时暂停 fullscreenchange(e) { if (!e.detail.fullScreen) { uni.createVideoContext('videoId', this).pause(); } }, //退出全屏时停止 fullscreenchange (e){ if(!e.detail.fullScreen){ this.videoContext.stop() } }
版权声明:本文为qq_59175937原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。