startRtmpOrRecording method
Future<void>
startRtmpOrRecording({
- required HMSRecordingConfig hmsRecordingConfig,
- HMSActionResultListener? hmsActionResultListener,
Starts rtmp streaming or recording on the parameters described in config.
Parameters:
hmsRecordingConfig - hmsRecordingConfig
is the HMSRecordingConfig which defines streaming/recording parameters for this start request.
hmsActionResultListener - hmsActionResultListener
is the callback that would be called by SDK in case of success or failure.
Implementation
Future<void> startRtmpOrRecording(
{required HMSRecordingConfig hmsRecordingConfig,
HMSActionResultListener? hmsActionResultListener}) async {
var arguments = hmsRecordingConfig.getJson();
var result = await PlatformService.invokeMethod(
PlatformMethod.startRtmpOrRecording,
arguments: arguments) as Map?;
if (hmsActionResultListener != null) {
if (result == null) {
hmsActionResultListener.onSuccess(
arguments: arguments,
methodType: HMSActionResultListenerMethod.startRtmpOrRecording);
} else {
hmsActionResultListener.onException(
arguments: arguments,
methodType: HMSActionResultListenerMethod.startRtmpOrRecording,
hmsException: HMSException.fromMap(result["error"]));
}
}
}