RecorderManager.offError

Remove event listeners that are previously registered using the RecorderManager.onError method. This stops the specified listener from monitoring the event triggered when an error occurs.

Parameters

Type

Required

Description

Function listener

No

The listener function that is passed to the RecorderManager.onError method. If this parameter is not specified, all RecorderManager.onError listeners are removed.

Sample code

copy
const recorderManager = my.getRecorderManager ();
const listener = res => {
  console.log ('on audio record error', res);
};

recorderManager.start ();
setTimeout (() => {
  recorderManager.stop ();
}, 5000);

recorderManager.onError (listener);
setTimeout (() => {
  recorderManager.offError (listener);
}, 5000);