startPreview method
Start current camera preview (with a render view).
Parameter viewModel
RtcSurfaceViewModel object.
Parameter config
RtcVideoConfig object.
Returns
- ResultCode.OK Success
- others: Failure
Note Must be called from main thread.
开启当前摄像头预览(随带渲染视图)。
Parameter viewModel
RtcSurfaceViewModel 对象。
Parameter config
RtcVideoConfig 对象。
Returns
- ResultCode.OK 成功
- 其他: 失败
Note 必须从主线程调用。
Implementation
@override
Future<ResultCode> startPreview(RtcSurfaceViewModel viewModel,
{RtcVideoConfig? config}) {
config ??= RtcVideoConfig();
return viewModel
.invokeCodeMethod('startPreview', {'config': config.toJson()});
}