planVideo: function () {
console.log(">>>>>>>>>>planVideo>>>>>")
var videoContext=this.data.videoContext
var isVideoPause=!this.data.isVideoPause
videoContext.play()
},
<video id="myVideo" bindloadedmetadata="bindloadedmetadata"
binderror="videoErrorCallback"
src="{{src}}"
bindpause="bindpause"
show-center-play-btn="{{false}}"
show-play-btn="{{false}}"
show-progress="{{false}}"
show-fullscreen-btn="{{false}}"
controls
custom-cache="{{false}}"
></video>
<cover-image class="play-btn" src="/images/act/icon3@2x.png" bindtap="planVideo" ></cover-image>
如代码所示,点击一个图片的调用play方法,真机上不能播放,开发工具上可以
试试别用变量保存上下文,每次操作的时候用 `wx.createVideoContext` 重新创建,比如 `wx.createVideoContext('myVideo').play()` 这样。