InnerAudioContext.offWaiting
2020-08-26 16:29 更新
解释:取消监听 onWaiting 事件
方法参数
Function callback
示例
图片示例
代码示例
<view class="wrap">
<view class="card-area">
<button type="primary" bindtap="offWaiting">取消监听onWaiting</button>
</view>
</view>
Page({
onLoad() {
const innerAudioContext = swan.createInnerAudioContext();
innerAudioContext.src = 'https://b.bdstatic.com/miniapp/images/yanyuan.mp3';
innerAudioContext.autoplay = false;
innerAudioContext.onWaiting(res => {
swan.showModal({
title: 'onWaiting',
content: '正在加载,请耐心等待'
});
console.log('onWaiting', res);
});
this.innerAudioContext = innerAudioContext;
this.innerAudioContext.play();
},
offWaiting() {
swan.showModal({
title: 'offWaiting',
content: '取消监听成功'
});
this.innerAudioContext.offWaiting();
}
});
以上内容是否对您有帮助:
更多建议: