stopAudioEffect
Introduction
Stop audio playback.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
id | String | true | The unique identifier for task. |
Example
Page({
data: {
id: '1',
},
onReady() {
this.setAudioEffectOption({ src: 'xxxx/xxx.mp3' }).then((res) => {
this.stop().then((res) => {
console.log('stopAudioEffect===', res);
});
});
},
setAudioEffectOption(option) {
return new Promise((resolve, reject) => {
dlt.setAudioEffectOption({
id: this.id,
option: JSON.stringify(option),
success: (res) => {
resolve(res);
},
fail: (err) => {
reject(err);
},
});
});
},
stop() {
return new Promise((resolve, reject) => {
dlt.stopAudioEffect({
id: this.id,
success: (res) => {
resolve(res);
},
fail: (err) => {
reject(err);
},
});
});
},
});