publishLiveStream method
void
publishLiveStream(
- RCRTCOutputStream stream,
- void onSuccess(
- RCRTCLiveInfo liveInfo
- void onError()
Implementation
void publishLiveStream(
RCRTCOutputStream stream,
void onSuccess(RCRTCLiveInfo liveInfo),
void onError(int code, String? message),
) async {
String? json = await methodChannel.invokeMethod("publishLiveStream", jsonEncode(stream));
Map<String, dynamic> result = jsonDecode(json!);
RCRTCLog.d(_tag, "publishLiveStream $result");
int code = result['code'] ?? -1;
String? content = result["content"];
if (code == 0) {
onSuccess(RCRTCLiveInfo.fromJSON(jsonDecode(content!)));
} else {
onError(code, content);
}
}