subscribeVideo method
Future<ResultCode>
subscribeVideo(
- String userId,
- RtcSurfaceViewModel viewModel, {
- RtcVideoConfig? config,
override
Subscribe to a user's video (with a render view).
Parameter userId
The user ID defined by customer.
Parameter viewModel
RtcSurfaceViewModel object.
Parameter config
RtcVideoConfig object.
Returns
- ResultCode.OK Success
- others: Failure
Note Before subscribing to a user’s video, please make sure the user has started the video. Must be called from main thread.
订阅用户的视频(随带渲染视图)。
Parameter userId
客户定义的用户标识。
Parameter viewModel
RtcSurfaceViewModel 对象。
Parameter config
RtcVideoConfig 对象。
Returns
- ResultCode.OK 成功
- 其他: 失败
Note 订阅用户的视频前,请确保用户已开启视频。 必须从主线程调用。
Implementation
@override
Future<ResultCode> subscribeVideo(
String userId, RtcSurfaceViewModel viewModel,
{RtcVideoConfig? config}) {
config ??= RtcVideoConfig();
return viewModel.invokeCodeMethod(
'subscribeVideo', {'userId': userId, 'config': config.toJson()});
}