InnerAudioContext.offError
The InnerAudioContext.offError
method allows mini program developers to remove an event listener previously registered with the InnerAudioContext.onError
method. This stops the specified listener from monitoring the event that occurs when an error occurs during playback.
Parameters
Type | Required | Description |
Function listener | No | The callback that is passed to the |
Sample code
copy
const listener = () => {
console.log ('on audio play error');
};
this.innerAudioContext = my.createInnerAudioContext ();
this.innerAudioContext.src = 'https://www.sample.com/sample.mp3';
this.innerAudioContext.play();
this.innerAudioContext.onError(listener);
this.innerAudioContext.offError(listener);