InnerAudioContext.offSeeking

2020-08-26 16:29 更新

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

方法參數(shù)

Function callback

示例 

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


圖片示例

代碼示例

<view class="container">
    <view class="card-area">
        <button type="primary" bindtap="seek">seek</button>
        <button type="primary" bindtap="offSeeking">offSeeking</button>
    </view>
</view>
Page({
    onLoad() {
        const innerAudioContext = swan.createInnerAudioContext();
        innerAudioContext.src = 'https://b.bdstatic.com/miniapp/images/yanyuan.mp3';
        innerAudioContext.autoplay = false;
        innerAudioContext.onPlay(res => {
            swan.showModal({
                title: 'onPlay',
                content: JSON.stringify(res)
            });
            console.log('onPlay', res);
        });
        innerAudioContext.onSeeking(res => {
            swan.showModal({
                title: 'onSeeking',
                content: JSON.stringify(res)
            });
        });
        this.innerAudioContext = innerAudioContext;
        this.innerAudioContext.play();
    },
    seek() {
        this.innerAudioContext.seek(80);
    },
    offSeeking() {
        swan.showModal({
            title: 'offSeeking',
            content: '取消監(jiān)聽成功'
        });
        this.innerAudioContext.offSeeking();
    }
});


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

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號