zoukankan      html  css  js  c++  java
  • 微信小程序 swiper和video的autoplay设置冲突问题

    之前微信小程序首页轮播是图片+视频的方式,自动轮播,视频不播放,昨天要改成不自动轮播,视频放首页自动播放,然后设置之后发现不起作用,会自动轮播+播放视频。

     <swiper indicator-color="rgba(255,255,255,.66)" indicator-active-color="#0CC187" autoplay="{{false}}" interval="4000" duration="1000" circular="false" class="tac" style="height: 422rpx;">
                <block wx:for="{{haibao}}" wx:key="key">
                    <swiper-item>
                        <video style=" 100%;height: 422rpx;" id="img" controls="false" autoplay="{{true}}"  bindplay="videos" bindpause="videos"  src='/aa.mp4'></video>
                    </swiper-item>
                    <swiper-item>
                        <navigator wx:if="{{item.img}}" >
                            <image src="{{item.img}}" class="img" mode="aspectFill" style="height: 422rpx;"></image>
                        </navigator>
                        <image wx:else src="{{item.img}}" class="img" mode="aspectFill" style="height: 422rpx;"></image>
                    </swiper-item>
                </block>
            </swiper>

    怎么也没定位到原因,最后百度发现是说video 标签的优先级最高,可能是video的autoplay覆盖掉了swiper的autoplay,这就很尴尬了,不能自动设置,最后没办法swiper不设置autoplay,因为默认的就是false,如果有谁还有好的解决方法请指点一下,因为能力文字只能找到解决方案没法找到具体问题根源

  • 相关阅读:
    设计数据库步骤
    sql练习题
    多表连接查询
    数据约束
    管理并行SQL执行的进程
    关于Oracle数据库后台进程
    配置数据库驻留连接池
    为共享服务器配置Oracle数据库
    关于数据库驻留连接池
    关于专用和共享服务器进程
  • 原文地址:https://www.cnblogs.com/zdzdbk/p/11810114.html
Copyright © 2011-2022 走看看