initRoomConnect static method
Future<void>
initRoomConnect(
- String token,
- Room currentRoom,
- LocalAudioTrack? autoTrack,
- LocalVideoTrack? videoTrack, {
- dynamic onError(
- dynamic
Implementation
static Future<void> initRoomConnect(String token, Room currentRoom, LocalAudioTrack? autoTrack, LocalVideoTrack? videoTrack, {Function(dynamic)? onError}) async {
try {
showLogI("[TOKEN]======> $token");
await currentRoom.prepareConnection(ApiConstant.urlConnectLivekit, token);
await currentRoom.connect(
ApiConstant.urlConnectLivekit,
token,
fastConnectOptions: FastConnectOptions(
microphone: TrackOption(enabled: true, track: autoTrack),
camera: TrackOption(enabled: videoTrack != null, track: videoTrack),
),
);
} catch (e) {
if (onError != null) onError(e);
}
}