requestJoinSubRoom method
ZH
请求加入子房间(跨房间连麦) @param roomId 目标房间id @param userId 目标主播id @param autoLayout 是否自动布局 开启自动布局 如果被邀请方在加入邀请方房间之前发布了资源,当被邀请方加入邀请者房间成功后,服务器会把被邀请方流资源合并到邀请方视图(默认仅悬浮布局合流)上。 如果被邀请方在加入邀请方房间之前没有发布过资源,将会在被邀请方发布资源成功后,服务器会把被邀请方流资源合并到邀请方视图(默认仅悬浮布局合流)上。 双方可以主动设置合流布局。一旦主动设置过合流布局,后续RTC直播过程中设置的自动合流参数将失效。 @param extra 附加信息,默认为空 @return 0: 成功, 非0: 失败
EN
Join a sub-room (cross-room co-streaming) @param roomId Target room ID @param userId Target host ID @param autoLayout Auto-layout toggle When enabled:
- If the invitee published streams before joining, their streams merge into inviter's view (floating layout by default) after joining
- If no streams published, merging occurs after the invitee starts streaming Both parties can manually set layouts. Manual settings override auto-layout during live streaming @param extra Additional info (optional) @return 0: success, non-zero: failure
Implementation
Future<int> requestJoinSubRoom(
String roomId,
String userId, [
bool autoLayout = true,
String? extra,
]) async {
Map<String, dynamic> arguments = {
'rid': roomId,
'uid': userId,
'auto': autoLayout,
'extra': extra,
};
int code =
await _channel.invokeMethod('requestJoinSubRoom', arguments) ?? -1;
return code;
}