connect static method
Future<Room>
connect(
- String url,
- String token, {
- ConnectOptions? connectOptions,
- RoomOptions? roomOptions,
Convenience method for connecting to a LiveKit server. Returns a Room upon a successful connect or throws when it fails. Alternatively, it is possible to instantiate Room and call Room.connect directly.
Implementation
static Future<Room> connect(
String url,
String token, {
ConnectOptions? connectOptions,
RoomOptions? roomOptions,
}) async {
final room = Room();
try {
await room.connect(
url,
token,
connectOptions: connectOptions,
roomOptions: roomOptions,
);
return room;
} catch (error) {
await room.dispose();
rethrow;
}
}