startPreview method

  1. @override
Future<ResultCode> startPreview(
  1. RtcSurfaceViewModel viewModel, {
  2. RtcVideoConfig? config,
})

Start current camera preview (with a render view).

Parameter viewModel RtcSurfaceViewModel object.

Parameter config RtcVideoConfig object.

Returns

Note Must be called from main thread.

开启当前摄像头预览(随带渲染视图)。

Parameter viewModel RtcSurfaceViewModel 对象。

Parameter config RtcVideoConfig 对象。

Returns

Note 必须从主线程调用。

Implementation

@override
Future<ResultCode> startPreview(RtcSurfaceViewModel viewModel,
    {RtcVideoConfig? config}) {
  config ??= RtcVideoConfig();
  return viewModel
      .invokeCodeMethod('startPreview', {'config': config.toJson()});
}