startVideo method
Future<ResultCode>
startVideo(
- int streamId,
- RtcSurfaceViewModel viewModel, {
- RtcVideoConfig? config,
override
start video stream with render window
Parameter streamId
Stream ID
Parameter viewModel
Platform specific view model.
Parameter config
Video configure
Returns
- ResultCode.OK Success
- others: Failure
Note Must be called from main thread on platform macOS iOS and Android.
开启视频流,并且设置渲染窗口
Parameter streamId
视频流 ID
Parameter viewModel
平台相关的窗口对象
Parameter config
视频配置参数
Returns
- ResultCode.OK 调用成功
- others: 调用失败
Note 在 macOS iOS and Android 平台下必须从主线程调用。
Implementation
@override
Future<ResultCode> startVideo(int streamId, RtcSurfaceViewModel viewModel,
{RtcVideoConfig? config}) {
config ??= RtcVideoConfig();
return viewModel.invokeCodeMethod('startVideoWithStreamId',
{'streamId': streamId, 'config': config.toJson()});
}