小程序异步加载的video标签,怎么操控play()方法?
发布于 6 年前 作者 panwei 10347 次浏览 来自 问答

<view class=“list-media”>

  <video wx:if="{{data.url}}" id="{{data.id}}" class=“media-video” src="{{data.url}}" bind:touchstart=“bindPlay1”>

    <cover-view wx:if="{{isPause}}" class=“controls” bind:touchstart=“bindPlay”>

      <cover-view class=“play”>

        <cover-image class=“img” src="{{data._indexpic}}"/>

      </cover-view>

    </cover-view>

  </video>

</view>

js:

    bindPlay1 (event) {

      this.videoCtx = wx.createVideoContext(event.currentTarget.id, this)

      console.log(this.videoCtx)

      this.videoCtx.play()

    }

打印如下

仍然无法播放

回到顶部