InnerAudioContext.offWaiting

2020-08-26 16:29 更新

解釋:取消監(jiān)聽 onWaiting 事件

方法參數(shù)

Function callback

示例 

在開發(fā)者工具中打開


圖片示例

代碼示例

<view class="wrap">
    <view class="card-area">
        <button type="primary" bindtap="offWaiting">取消監(jiān)聽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: '取消監(jiān)聽成功'
        });
        this.innerAudioContext.offWaiting();
    }
});


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號