自定义组件中使用createVideoContext的pause开发者工具中无效
自定义了一个组件,命名为test,里面只是用了video组件,在组件的test.js中写到
methods: { pausev: function (){ this .videoContext.pause(); console.log( this .videoContext); } }, ready: function (){ this .videoContext = wx.createVideoContext( 'myVideo' , this ); } |
test.wxml如下
< view > < video id = "myVideo" src = "http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400" controls></ video > < button bindtap = "pausev" >Pause</ button > </ view > |
测试的是组件中点击button试图暂停正在播放的视频,实际测试的时候,真机上可以暂停,开发者工具中暂停失败,打印的时候是有method:pause