swiper 第一个item包含的video无法播放
发布于 4 年前 作者 min29 3466 次浏览 来自 问答

业务需求,采用swiper为容器,里面image和video进行混合显示,

之前还是能够正常运行的。但是6月21号,在代码未做过变动的情况下,突然在swiper里面的第一个video就无法播放了,20号的时候发现了ios大概率无法

播放的问题,但是当时android还是好的。

代码片段如下:

<swiper wx:if="{{false}}" indicator-dots="{{false}}" autoplay="{{false}}" interval="{{false}}" style=‘width:100%; height:{{mainHeight}}px;’ current=’{{currentIdx}}’ bindchange=‘swiperChange’>

    <block wx:for="{{details}}" wx:key="*this">

        <swiper-item>

            <view style=‘margin-top:20rpx;’ bindtap=‘backTap’>

                <image src="{{item.pictureURL}}{{ossProcess}}" mode=“aspectFit” style=“width:100%; height:{{mainHeight}}px;” wx:if="{{item.type == ‘p’}}"></image>

                <video src="{{item.videoURL}}" object-fit=“contain” controls="{{false}}" autoplay="{{false}}" loop="{{true}}" muted="{{muteEnable}}" show-fullscreen-btn="{{false}}" show-play-btn="{{false}}" show-center-play-btn="{{false}}" enable-progress-gesture="{{false}}" show-mute-btn="{{true}}" enable-play-gesture="{{false}}" style=“width:100%; height:{{mainHeight}}px;” wx:if="{{item.type == ‘v’ }}" webkit-playsinline playsinline id=‘video{{index}}’ data-index=’{{index}}’ data-swiperindex="{{swiperindex}}" bindwaiting=‘videoBindWaiting’ binderror=‘videoBindError’ custom-cache="{{false}}"></video>

            </view>

        </swiper-item>

    </block>

</swiper>

1 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部