createRoom static method
Room
createRoom({
- required String roomId,
- required String displayName,
- required String token,
- bool micEnabled = true,
- bool camEnabled = true,
- String participantId = '',
- String maxResolution = 'sd',
- int defaultCameraIndex = 0,
- bool multiStream = true,
- CustomTrack? customCameraVideoTrack,
- CustomTrack? customMicrophoneAudioTrack,
- NotificationInfo notification = const NotificationInfo(title: "Video SDK", message: "Video SDK is sharing screen in the meeting", icon: "notification_share"),
- Mode mode = Mode.CONFERENCE,
- Map<
String, dynamic> metaData = const {},
Implementation
static Room createRoom({
required String roomId,
required String displayName,
required String token,
bool micEnabled = true,
bool camEnabled = true,
String participantId = '',
String maxResolution = 'sd',
int defaultCameraIndex = 0,
bool multiStream = true,
CustomTrack? customCameraVideoTrack,
CustomTrack? customMicrophoneAudioTrack,
NotificationInfo notification = const NotificationInfo(
title: "Video SDK",
message: "Video SDK is sharing screen in the meeting",
icon: "notification_share",
),
Mode mode = Mode.CONFERENCE,
Map<String,dynamic> metaData = const {}
}) {
//
participantId = participantId.isNotEmpty ? participantId : randomAlpha(8);
//
if (token.isEmpty) {
//
//
// VideoSDKLog.createLog(
// message: "Token is empty or invalid.",
// logLevel: "ERROR");
//
throw "Token is empty or invalid.";
}
Room room = Room(
participantId: participantId,
displayName: displayName,
maxResolution: maxResolution,
camEnabled: camEnabled,
micEnabled: micEnabled,
meetingId: roomId,
multiStream: multiStream,
token: token,
notification: notification,
defaultCameraIndex: defaultCameraIndex,
customCameraVideoTrack: customCameraVideoTrack,
customMicrophoneAudioTrack: customMicrophoneAudioTrack,
mode: mode,
metaData: metaData);
if (!kIsWeb) {
if (!Platform.isMacOS && !Platform.isWindows) {
_eventChannel.receiveBroadcastStream().listen((event) {
if (event == "STOP_SCREENSHARE") {
room.disableScreenShare();
} else if (event == "START_SCREENSHARE") {
room.enableShare(null, iosPermissionGiven: true);
}
});
}
}
//
return room;
}