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,如果有谁还有好的解决方法请指点一下,因为能力文字只能找到解决方案没法找到具体问题根源

  • 相关阅读:
    MySQL锁概述
    MYSQL删除重复记录
    SPRING事务控制
    性能测试中如何确定并发用户数
    Jsoup操作
    linux根据端口号查询进程
    linux下解压jar文件
    开发阶段的logback.xml
    栈--getMin(leetcode 155)
    git "fatal: The remote end hung up unexpectedly"
  • 原文地址:https://www.cnblogs.com/zdzdbk/p/11810114.html
Copyright © 2011-2022 走看看