组件内用wx.createVideoContext(id)后play()不行,是什么原因啊?
自定义组件内wxml
<video id="myvideo2" src='https://peacebird-img.oss-cn-shanghai.aliyuncs.com/wx/2019-12-11-bar-12.mp4' enable-danmu danmu-btn controls>
<cover-view bindtap="videoPlayCover">
<cover-image class="img" src="http://ofstudio.com/tempimag/001.jpg" style="width: 50%;" />
</cover-view>
</video>
自定义组件内JS
methods: {
videoPlayCover() {
var video = wx.createVideoContext('myvideo2');
console.log(video)
video.play();
}
}
video.play(); //执行失败