uniapp视频层级过高解决方案
文章描述:
uniapp视频在app里面层级过高的解决方法以及处理
template
视图模块里面一个是视频模块一个是遮罩层
<template>
	<view class="container">
		<view class="vo-video" v-html="item.content" > </view>
		<view class="popup" v-if="popup"></view>
	</view>
</template>script
视频地址可以是固定链接也可以是变量
export default{
	data(){
		return{
			url:"https://www.miyil.com/statics/videos/huoyingrenzhe_changmen_sl.mp4",
			item:[],
			popup:true
		}
	},
	onLoad() {
		//this.item.content = '<video  src="https://www.miyil.com/statics/videos/huoyingrenzhe_changmen_sl.mp4" style="max-width:100%;" controls="controls"></video>';
		this.item.content = '<video  src="'+this.url+'" style="max-width:100%;" controls="controls"></video>';
	},
	methods:{
		
	}
}style
.container{
	padding: 30upx 40upx;
}
.popup{width: 100%; height: 100%; display: block; position: fixed; top: 0; left: 0; bottom: 0; background-color:rgba(0,0,0,.3); }
.pup-model{}
视频层级还可以使用cover-view来解决,相对来说cover-view使用起来不是那么的方便。
                发布时间:2022/05/13 
                
            
发表评论