registerMediaMetadataObserver abstract method

void registerMediaMetadataObserver({
  1. required MetadataObserver observer,
  2. required MetadataType type,
})

Registers the metadata observer.

You need to implement the MetadataObserver class and specify the metadata type in this method. This method enables you to add synchronized metadata in the video stream for more diversified live interactive streaming, such as sending shopping links, digital coupons, and online quizzes. Call this method before joinChannel.

  • observer The metadata observer. See MetadataObserver.
  • type The metadata type. The SDK currently only supports videoMetadata.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. < 0: Failure.

Implementation

void registerMediaMetadataObserver(
    {required MetadataObserver observer, required MetadataType type});