InnerAudioContext.offSeeking

解释:取消监听 onSeeking 事件

# 方法参数

Function callback

# 示例

扫码体验
重新加载
请使用百度APP扫码

# 图片示例

# 代码示例

    <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: '取消监听成功'
            });
            this.innerAudioContext.offSeeking();
        }
    });