Inherits agora_gaming_rtc.IMetadataObserver.

Public Member Functions

delegate void OnMediaMetaDataReceivedHandler (Metadata metadata)
delegate bool OnReadyToSendMetadataHandler (ref Metadata metadata)
delegate int OnGetMaxMetadataSizeHandler ()
override int RegisterMediaMetadataObserver (METADATA_TYPE metaDataType)
override int UnRegisterMediaMetadataObserver ()

Detailed Description

The definition of MetadataObserver.

Member Function Documentation

◆ OnMediaMetaDataReceivedHandler()

delegate void agora_gaming_rtc.MetadataObserver.OnMediaMetaDataReceivedHandler ( Metadata  metadata)

Occurs when the local user receives the metadata.

metadataThe received Metadata.

◆ OnReadyToSendMetadataHandler()

delegate bool agora_gaming_rtc.MetadataObserver.OnReadyToSendMetadataHandler ( ref Metadata  metadata)

Occurs when the SDK is ready to receive and send metadata.

Ensure that the size of the metadata does not exceed the value set in the OnGetMaxMetadataSizeHandler callback.
metadataThe Metadata to be sent.
  • true: Send.
  • false: Do not send.

◆ OnGetMaxMetadataSizeHandler()

delegate int agora_gaming_rtc.MetadataObserver.OnGetMaxMetadataSizeHandler ( )

Occurs when the SDK requests the maximum size of the metadata.

The metadata includes the following parameters:

  • uid: The ID of the user who sent the metadata.
  • size: The buffer size of the sent or received metadata.
  • buffer: The buffer address of the sent or received metadata.
  • timeStampMs: Time statmp of the frame following the metadata.

The SDK triggers this callback after you successfully call the RegisterMediaMetadataObserver method. You need to specify the maximum size of the metadata in the return value of this callback.

The maximum size of the buffer of the metadata that you set. The highest value is 1024 bytes. Ensure that you set the return value, if not, OnGetMaxMetadataSizeHandler returns 1024, which is the default maximum size of the metadata.

◆ RegisterMediaMetadataObserver()

override int agora_gaming_rtc.MetadataObserver.RegisterMediaMetadataObserver ( METADATA_TYPE  metaDataType)

Registers a metadata observer.

You need to implement the MetadataObserver class and specify the metadata type in this method. A successful call of this method triggers the OnGetMaxMetadataSizeHandler callback. This method enables you to add synchronized metadata in the video stream for more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes.

  • Call this method before the JoinChannelByKey method.
  • This method applies to the Live-broadcast channel profile.
metaDataTypeSee METADATA_TYPE. The SDK supports VIDEO_METADATA(0) only for now.
  • 0: Success.
  • < 0: Failure.

◆ UnRegisterMediaMetadataObserver()

override int agora_gaming_rtc.MetadataObserver.UnRegisterMediaMetadataObserver ( )

UnRegisters the metadata observer.

  • 0: Success.
  • < 0: Failure.