enterRoom method
Future<TUIValueCallBack<TUIRoomInfo>>
enterRoom(
- String roomId,
- bool enableMic,
- bool enableCamera,
- bool isSoundOnSpeaker,
)
Implementation
Future<TUIValueCallBack<TUIRoomInfo>> enterRoom(String roomId, bool enableMic,
bool enableCamera, bool isSoundOnSpeaker) async {
_setFramework();
TUIValueCallBack<TUIRoomInfo> result = await _roomEngine.enterRoom(roomId);
if (result.code == TUIError.success) {
RoomStore.to.roomInfo = result.data!;
RoomStore.to.isEnteredRoom = true;
RoomStore.to.timeStampOnEnterRoom = DateTime.now().millisecondsSinceEpoch;
await RoomStore.to.initialCurrentUser();
await _getUserList();
bool isTakeSeatSuccess = await _autoTakeSeatForOwner();
if (!isTakeSeatSuccess) {
result.code = TUIError.errUserNotInSeat;
}
RoomStore.to.initItemTouchableState();
_decideMediaStatus(enableMic, enableCamera, isSoundOnSpeaker);
if (RoomStore.to.currentUser.userRole.value != TUIRole.generalUser) {
getSeatApplicationList();
}
if (GetPlatform.isAndroid) {
RtcConferenceTuikitPlatform.instance.startForegroundService();
}
}
return result;
}