registerMediaMetadataObserver abstract method

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

Registers a media metadata observer to receive or send metadata.

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

  • observer The metadata observer. See MetadataObserver.
  • type The metadata type. Currently only videoMetadata is supported.

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. See Error Codes for details and resolution suggestions. < 0: The method call fails. See Error Codes for details and resolution suggestions.

Implementation

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