Voice SDK v3.7.1 API Reference for Unity
Public Member Functions | List of all members
agora_gaming_rtc.MetadataObserver Class Reference

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

◆ 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.

Returns
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.

◆ OnMediaMetaDataReceivedHandler()

delegate void agora_gaming_rtc.MetadataObserver.OnMediaMetaDataReceivedHandler ( Metadata  metadata )

Occurs when the local user receives the metadata.

Parameters
metadata The received Metadata.

◆ OnReadyToSendMetadataHandler()

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

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

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

◆ 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 interactive live streaming interactions, such as sending shopping links, digital coupons, and online quizzes.

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

◆ UnRegisterMediaMetadataObserver()

override int agora_gaming_rtc.MetadataObserver.UnRegisterMediaMetadataObserver ( )

UnRegisters the metadata observer.

Returns
  • 0: Success.
  • < 0: Failure.

The documentation for this class was generated from the following file: