1、普通情况:图片要遮住<video></video>
请使用cover-image或cover-view
情况1:如上图,注意要使用以下位置才能达到遮住的效果
//方法1:放入video中---------------------------------------- <video> <cover-image></cover-image> </video> //方法2:放入video同层级---------------------------------------- <video></video> <cover-image></cover-image> //放后面or放前面都可以 <cover-image></cover-image> <video></video> ---------------------------------------- //然后在css中定义cover-image的位置为 position: absolute; right:XXX;//定位 top:XXX;//定位
情况2:如上图,就直接用cover-view自定义一个顶部组件,就可以遮住视频了
2、和swiper组件混搭使用,出现左右滑动video的时候,浮动在其上面的cover-view或cover-image会有飘忽不定,位置错位的情况,如何解决?
如上图,当左右滑动swiper-item的时候,就出现image的图标位置错位了
//一定要将标签放入<xxx></xxx>之间---------------------------------------- <uni-swiper-dot> <swiper> <swiper-item v-for="(item,index) in items"> <image:src="item.videoCover"> //一定要放在这里 <cover-image src="/img/xxx.png"></cover-image> //一定要放在这里 <cover-view>这里放内容</cover-view> </image> </swiper-item> </swiper> </uni-swiper-dot>





