uniapp 点击显示全屏视频
官网html<video v-show="popup_show" id="popup_video" :src="视频路径" object-fit="fill" :show-center-play-btn="false" :controls="true" @fullscreenchange="fullscreenchange"></video>js// 点击显示全屏this.
·
html
<video id="popup_video" :src="视频路径" object-fit="fill" :show-center-play-btn="false" :controls="true" @fullscreenchange="fullscreenchange"></video>
js
// 点击显示全屏
this.videoContext = uni.createVideoContext('popup_video', this);
this.videoContext.requestFullScreen();
// 退出全屏的时候暂停视频
fullscreenchange(e) {
if (!e.detail.fullScreen) {
this.videoContext.pause()
}
}
更多推荐
已为社区贡献6条内容
所有评论(0)