startVideo method
Start video (with a render view).
Parameter viewModel
RtcSurfaceViewModel object.
Parameter config
RtcVideoConfig object.
Returns
- ResultCode.OK Success
- others: Failure
Note Please join one channel before starting video, otherwise it will fail. Must be called from main thread.
开启视频(随带渲染视图)。
Parameter viewModel
RtcSurfaceViewModel 对象。
Parameter config
RtcVideoConfig 对象。
Returns
- ResultCode.OK 成功
- 其他: 失败
Note 开启视频前请先加入一个频道,否则将返回失败。 必须从主线程调用。
Implementation
@override
Future<ResultCode> startVideo(RtcSurfaceViewModel viewModel,
{RtcVideoConfig? config}) {
config ??= RtcVideoConfig();
return viewModel
.invokeCodeMethod('startVideo', {'config': config.toJson()});
}