startHlsStreaming method
Future<HMSException?>
startHlsStreaming({
- HMSHLSConfig? hmshlsConfig,
- HMSActionResultListener? hmsActionResultListener,
Starts HLS streaming for the meetingUrl
room.
You can set a custom metadata
for the HLS Stream
hmsActionResultListener
is a callback whose HMSActionResultListener.onSuccess will be called when the action completes successfully.
Refer HLS Streaming guide here
Implementation
Future<HMSException?> startHlsStreaming(
{HMSHLSConfig? hmshlsConfig,
HMSActionResultListener? hmsActionResultListener}) async {
var result = await PlatformService.invokeMethod(
PlatformMethod.startHlsStreaming,
arguments: hmshlsConfig?.toMap());
if (hmsActionResultListener != null) {
if (result != null) {
hmsActionResultListener.onException(
hmsException: HMSException.fromMap(result["error"]),
methodType: HMSActionResultListenerMethod.hlsStreamingStarted);
return HMSException.fromMap(result["error"]);
} else {
hmsActionResultListener.onSuccess(
methodType: HMSActionResultListenerMethod.hlsStreamingStarted);
return null;
}
}
return null;
}