IMetadataObserver

The metadata observer.

You can call registerMediaMetadataObserver to register or unregister the IMetadataObserver object.

getMaxMetadataSize

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

public abstract int getMaxMetadataSize();

After successfully complete the registration by calling registerMediaMetadataObserver, the SDK triggers this callback once every video frame is sent. 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 want to use. The highest value is 1024 bytes. Ensure that you set the return value.

onMetadataReceived

Occurs when the local user receives the metadata.

@CalledByNative public abstract void onMetadataReceived(byte[] buffer, int uid, long timeStampMs);

Parameters

buffer
received data.
uid
The user ID.
timeStampMs
The timestamp.

onReadyToSendMetadata

Occurs when the SDK is ready to send metadata.

@CalledByNative public abstract byte[] onReadyToSendMetadata(long timeStampMs, int sourceType);

This callback is triggered when the SDK is ready to send metadata.

Attention: Ensure that the size of the metadata does not exceed the value set in the getMaxMetadataSize callback.

Parameters

timeStampMs
The timestamp.
sourceType
Video data type. See VideoSourceType.

Returns

The metadata that you want to send in the format of byte. Ensure that you set the return value.