Agora Java API Reference for Android

Public Member Functions | List of all members
io.agora.rtc2.IMediaExtensionObserver Interface Reference

## Public Member Functions
default void | onEventWithContext (ExtensionContext extContext, String key, String value)
| The event callback of the extension. More...
default void | onStartedWithContext (ExtensionContext extContext)
| Occurs when the extension is enabled. More...
default void | onStoppedWithContext (ExtensionContext extContext)
| Occurs when the extension is disabled. More...
default void | onErrorWithContext (ExtensionContext extContext, int error, String message)
| Occurs when the extension runs incorrectly. More...

## Member Function Documentation

## ◆ onEventWithContext()

default void io.agora.rtc2.IMediaExtensionObserver.onEventWithContext | ( | ExtensionContext | extContext,
|  | String | key,
|  | String | value
| ) |  |

The event callback of the extension.

To listen for events while the extension is running, you need to register this callback.

Parameters

  extContext | The context information of the extension, see `ExtensionContext`.
  key | The key of the extension.
  value | The value of the extension key.

## ◆ onStartedWithContext()

default void io.agora.rtc2.IMediaExtensionObserver.onStartedWithContext | ( | ExtensionContext | extContext | ) |

Occurs when the extension is enabled.

The callback is triggered after the extension is successfully enabled.

Parameters

  extContext | The context information of the extension, see `ExtensionContext`.

## ◆ onStoppedWithContext()

default void io.agora.rtc2.IMediaExtensionObserver.onStoppedWithContext | ( | ExtensionContext | extContext | ) |

Occurs when the extension is disabled.

The callback is triggered after the extension is successfully disabled.

Parameters

  extContext | The context information of the extension, see `ExtensionContext`.

## ◆ onErrorWithContext()

default void io.agora.rtc2.IMediaExtensionObserver.onErrorWithContext | ( | ExtensionContext | extContext,
|  | int | error,
|  | String | message
| ) |  |

Occurs when the extension runs incorrectly.

In case of extension enabling failure or runtime errors, the extension triggers this callback and reports the error code along with the reasons.

Parameters

  extContext | The context information of the extension, see `ExtensionContext`.
  error | Error code. For details, see the extension documentation provided by the extension provider.
  message | Reason. For details, see the extension documentation provided by the extension provider.