双人连线 | 多人连线 |
| |
requestCrossRoomConnection
发起连线,在参数 roomId 中传入需要连线的主播 B 房间 id。val roomId = "anchorBRoomId"mLiveViewList.requestCrossRoomConnection(roomId, 10, null)
String roomId = "anchorBRoomId";mLiveViewList.requestCrossRoomConnection(roomId, 10, null);
let roomId = "anchorRoomId"liveCoreView.requestCrossRoomConnection(roomId: roomId, timeOut: 60) {} onError: { code, message in}
NSString *roomId = @"anchorRoomId";[liveCoreView requestCrossRoomConnection:roomIdtimeOut:60onSuccess:^(void) {} onError:^(NSInteger code, NSString * _Nonnull message) {}];
onCrossRoomConnectionAccepted
接收请求同意回调。onCrossRoomConnectionRequest
接收连线请求回调。override fun onCrossRoomConnectionRequest(inviterUser: UserInfo) {Log.i(TAG, "收到主播A连线房间请求:${inviterUser.userId}")}
@Overridepublic void onCrossRoomConnectionRequest(LiveStreamDefine.RoomInfo roomInfo) {Log.i(TAG, "收到主播A连线房间请求:" + roomInfo.roomId);}
func onCrossRoomConnectionRequest(hostUser: TUIConnectionUser) {print("收到主播A连线房间请求:\\(hostUser.userId)")}
- (void)onCrossRoomConnectionRequest:(TUIConnectionUser *)hostUser {NSLog(@"收到主播A连线房间请求:%@", hostUser.userId);}
respondToCrossRoomConnection
响应连线请求。liveCoreView.respondToCrossRoomConnection(roomId, true, null)
// 同意连线请求liveCoreView.respondToCrossRoomConnection(roomId, true, null);
liveCoreView.respondToCrossRoomConnection(roomId: roomId, isAccepted: true) {} onError: { code, message in}
[liveCoreView respondToCrossRoomConnection:roomIdisAccepted:trueonSuccess:^(void) {} onError:^(NSInteger code, NSString * _Nonnull message) {}];
onConnectedRoomsUpdated
回调,收到接收连线列表发生变化通知。 override fun onConnectedRoomsUpdated(inviterUser: UserInfo) {Log.i(TAG, "主播连线房间列表更新")}
@Overridepublic void onConnectedRoomsUpdated(List<LiveStreamDefine.RoomInfo> roomList) {Log.i(TAG, "主播连线房间列表更新");}
func onConnectedRoomsUpdated(hostUserList: [TUIConnectionUser]) {print("主播连线房间列表更新")}
- (void)onConnectedRoomsUpdated:(NSArray<TUIConnectionUser *> *)hostUserList {NSLog(@"主播连线房间列表更新");}
terminateIntraRoomConnection
退出连线。public void disconnect(TUIRoomDefine.ActionCallback callback) {mTUILiveConnectionManager.disconnect(callback);}
liveCoreView.terminateIntraRoomConnection()
liveCoreView.terminateCrossRoomConnection()
[liveCoreView terminateCrossRoomConnection];
本页内容是否解决了您的问题?