sendHLSTimedMetadata method
Future<void>
sendHLSTimedMetadata({
- required List<
HMSHLSTimedMetadata> metadata, - HMSActionResultListener? hmsActionResultListener,
Method to send Timed metadata for HLS Stream
Parameters:
metadata - metadata
the data which you wish to send as metadata
hmsActionResultListener - hmsActionResultListener
is a callback whose HMSActionResultListener.onSuccess will be called when the action completes successfully.
Refer send HLS Timed Metadata
Implementation
Future<void> sendHLSTimedMetadata(
{required List<HMSHLSTimedMetadata> metadata,
HMSActionResultListener? hmsActionResultListener}) async {
var args = {"metadata": metadata.map((e) => e.toMap()).toList()};
var result = await PlatformService.invokeMethod(
PlatformMethod.sendHLSTimedMetadata,
arguments: args);
if (hmsActionResultListener != null) {
if (result == null) {
hmsActionResultListener.onSuccess(
methodType: HMSActionResultListenerMethod.sendHLSTimedMetadata,
arguments: args);
} else {
hmsActionResultListener.onException(
methodType: HMSActionResultListenerMethod.sendHLSTimedMetadata,
hmsException: HMSException.fromMap(result["error"]));
}
}
}