赞
踩
下面是我用的插件地址,感觉还不错的
https://ext.dcloud.net.cn/plugin?id=284
<uni-swiper-dot :info="info" :current="current" :mode="mode" :dots-styles="dotsStyles" field="content" class="swiper"> <swiper class="swiper-box" @change="change"> <!-- 这里是video代码,至于里面的属性的话根据你们的需求去添加 poster是视频封面图片 src就是视频地址了 --> <view class="page"> <video class="video" id="myVideo" poster="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fa2.att.hudong.com%2F27%2F81%2F01200000194677136358818023076.jpg&refer=http%3A%2F%2Fa2.att.hudong.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1612149661&t=705c026e67f6aa1efe4ba4b64f546db7" style="width: 100%;" id="demoVideo" :controls="true" :enable-progress-gesture="false" :show-center-play-btn="true" src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400"> </video> </view> <!-- 到这里结束 --> <!-- 下面这部分是图片轮播展示 --> <swiper-item v-for="(item, index) in info" :key="index"> <view :class="item.colorClass" class="swiper-item"> <image class="image" :src="item.thumbnail_url" mode="aspectFill" /> </view> </swiper-item> </swiper> </uni-swiper-dot>
onReady() {
this.videoplay = uni.createVideoContext('myVideo')
},
//轮播 组件的change事件加入这行代码即可
change(e) {
this.videoplay.pause()
},
如果类似问题走不通,请留言
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。