import 'package:fis_lib_media_rt/base/room.dart';
import 'package:fis_lib_media_rt/implementations/nt_rtmp/room.dart';
import 'package:fis_lib_media_rt/implementations/trtc/room.dart';

import 'config.dart';

/// 实时音视频
class FRealTimeMedia {
  FRealTimeMedia._();

  /// 创建房间
  ///
  /// [roomId] 房间号
  ///
  /// [serviceType] 服务类型
  ///
  /// [member] 本地成员
  static BaseRoom createRoom(
    String roomId,
    FRealTimeMediaServiceType serviceType,
  ) {
    // 全局确定服务类型
    FRTMediaConfig.serviceType = serviceType;

    if (serviceType == FRealTimeMediaServiceType.trtc) {
      return TrtcRoom(id: roomId);
    } else if (serviceType == FRealTimeMediaServiceType.ntRtmp) {
      return NTRtmpRoom();
    }
    // TODO:
    return TrtcRoom(id: roomId);
  }
}
