startVideo method

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

Start video (with a render view).

Parameter viewModel RtcSurfaceViewModel object.

Parameter config RtcVideoConfig object.

Returns

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

Note 开启视频前请先加入一个频道,否则将返回失败。 必须从主线程调用。

Implementation

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