InnerAudioContext.offSeeking
Function callback
示例
请使用百度APP扫码
- 在 swan 文件中
- 在 js 文件中
onLoad() {
const innerAudioContext = swan.createInnerAudioContext();
innerAudioContext.src = 'https://vd3.bdstatic.com/mda-ic7mxzt5cvz6f4y5/mda-ic7mxzt5cvz6f4y5.mp3';
innerAudioContext.autoplay = false;
innerAudioContext.onPlay(res => {
title: 'onPlay',
content: JSON.stringify(res)
});
console.log('onPlay', res);
innerAudioContext.onSeeking(res => {
swan.showModal({
title: 'onSeeking',
content: JSON.stringify(res)
});
});
innerAudioContext.onEnded(res => {
innerAudioContext.offSeeking();
this.innerAudioContext = innerAudioContext;
},
seek() {
this.innerAudioContext.seek(80);
},
offSeeking(){
swan.showModal({
title: 'offSeeking',
content: '取消监听成功'
});
this.innerAudioContext.offSeeking();