onJoinLive method

void onJoinLive(
  1. TUIRoomInfo roomInfo
)

Implementation

void onJoinLive(TUIRoomInfo roomInfo) async {
  roomState.roomId = roomInfo.roomId;
  roomState.createTime = roomInfo.createTime;
  roomState.roomName = roomInfo.name ?? '';
  roomState.liveStatus.value = LiveStatus.playing;

  final result = await service.fetchLiveInfo(roomInfo.roomId);
  if (result.code != TUIError.success || result.data == null) {
    LiveKitLogger.error(ErrorHandler.convertToErrorMessage(
            result.code.rawValue, result.message) ??
        '');
    return;
  }
  _updateLiveInfo(result.data!);
}