Video 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

◆ OnMediaMetaDataReceivedHandler()

delegate void agora_gaming_rtc.MetadataObserver.OnMediaMetaDataReceivedHandler ( Metadata  metadata)

Occurs when the local user receives the metadata.

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

Note
Ensure that the size of the metadata does not exceed the value set in the OnGetMaxMetadataSizeHandler callback.
Parameters
metadataThe Metadata to be sent.
Returns
  • 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.

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.

◆ GetInstance()

static MetadataObserver agora_gaming_rtc.MetadataObserver.GetInstance ( IRtcEngine  irtcEngine)
static

◆ releaseInstance()

static void agora_gaming_rtc.MetadataObserver.releaseInstance ( )
static

◆ SetEngine()

void agora_gaming_rtc.MetadataObserver.SetEngine ( IRtcEngine  irtcEngine)

◆ RegisterMediaMetadataObserver()

override int agora_gaming_rtc.MetadataObserver.RegisterMediaMetadataObserver ( METADATA_TYPE  metaDataType)
virtual

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
metaDataTypeSee METADATA_TYPE. The SDK supports VIDEO_METADATA(0) only for now.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IMetadataObserver.

◆ UnRegisterMediaMetadataObserver()

override int agora_gaming_rtc.MetadataObserver.UnRegisterMediaMetadataObserver ( )
virtual

UnRegisters the metadata observer.

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

Implements agora_gaming_rtc.IMetadataObserver.

Member Data Documentation

◆ defaultMaxMetaDataSize

const int agora_gaming_rtc.MetadataObserver.defaultMaxMetaDataSize = 1024
static

◆ _OnMediaMetaDataReceived

OnMediaMetaDataReceivedHandler agora_gaming_rtc.MetadataObserver._OnMediaMetaDataReceived

◆ _OnReadyToSendMetadata

OnReadyToSendMetadataHandler agora_gaming_rtc.MetadataObserver._OnReadyToSendMetadata

◆ _OnGetMaxMetadataSize

OnGetMaxMetadataSizeHandler agora_gaming_rtc.MetadataObserver._OnGetMaxMetadataSize

◆ _metaDataObserver

MetadataObserver agora_gaming_rtc.MetadataObserver._metaDataObserver = null
static

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