-
public final class RoomLocalKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static <ERROR CLASS>RoomLocal
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>getRoomLocal()CompositionLocal for the Room currently provided by RoomScopeNot to be confused with LocalParticipant. final static UnitHandleRoomState(List<Room.State> states, Room passedRoom, Object keys, SuspendFunction3<CoroutineScope, Room, Room.State, Unit> onState)A simple handler for listening to room state changes. final static UnitHandleRoomState(Room.State state, Room passedRoom, Object keys, SuspendFunction3<CoroutineScope, Room, Room.State, Unit> onState)final static RoomrememberLiveKitRoom(String url, String token, Boolean audio, Boolean video, Boolean connect, RoomOptions roomOptions, LiveKitOverrides liveKitOverrides, ConnectOptions connectOptions, SuspendFunction2<CoroutineScope, Room, Unit> onConnected, SuspendFunction2<CoroutineScope, Room, Unit> onDisconnected, Function2<Room, Exception, Unit> onError, Room passedRoom, Boolean disconnectOnDispose)Remembers a new Room object. final static UnitRoomScope(String url, String token, Boolean audio, Boolean video, Boolean connect, RoomOptions roomOptions, LiveKitOverrides liveKitOverrides, ConnectOptions connectOptions, SuspendFunction2<CoroutineScope, Room, Unit> onConnected, SuspendFunction2<CoroutineScope, Room, Unit> onDisconnected, Function2<Room, Exception, Unit> onError, Room passedRoom, Boolean disconnectOnDispose, Function1<Room, Unit> content)Establishes a room scope which remembers a Room object which can be accessed through the RoomLocal composition local. final static RoomrequireRoom(Room passedRoom)Returns the passedRoom or the currently provided RoomLocal. -
-
Method Detail
-
getRoomLocal
final <ERROR CLASS> getRoomLocal()
CompositionLocal for the Room currently provided by RoomScope
Not to be confused with LocalParticipant.
-
HandleRoomState
@Composable() final static Unit HandleRoomState(List<Room.State> states, Room passedRoom, Object keys, SuspendFunction3<CoroutineScope, Room, Room.State, Unit> onState)
A simple handler for listening to room state changes.
- Parameters:
states- the types of states to listen to, or empty list to listen to all state changes.passedRoom- the room to use, or null to use RoomLocal if inside a RoomScope.keys- any keys that should be tracked to relaunch the handler with new keys.onState- the listener to be called back.
-
HandleRoomState
@Composable() final static Unit HandleRoomState(Room.State state, Room passedRoom, Object keys, SuspendFunction3<CoroutineScope, Room, Room.State, Unit> onState)
-
rememberLiveKitRoom
@Composable() final static Room rememberLiveKitRoom(String url, String token, Boolean audio, Boolean video, Boolean connect, RoomOptions roomOptions, LiveKitOverrides liveKitOverrides, ConnectOptions connectOptions, SuspendFunction2<CoroutineScope, Room, Unit> onConnected, SuspendFunction2<CoroutineScope, Room, Unit> onDisconnected, Function2<Room, Exception, Unit> onError, Room passedRoom, Boolean disconnectOnDispose)
Remembers a new Room object.
- Parameters:
url- the url of the livekit server to connect to.token- the token to connect to livekit with.audio- enable or disable audio.video- enable or disable video.connect- whether the room should be automatically connected to the server.roomOptions- options to pass to the Room.liveKitOverrides- overrides to pass to the Room.connectOptions- options to use when connecting.onConnected- a listener to be called upon room connection.onDisconnected- a listener to be called upon room disconnection.onError- a listener to be called upon room error.passedRoom- if a Room is provided, it will be used.disconnectOnDispose- by default, this composable handles the connection management and will disconnect the room when the composable goes out of scope.
-
RoomScope
@Composable() final static Unit RoomScope(String url, String token, Boolean audio, Boolean video, Boolean connect, RoomOptions roomOptions, LiveKitOverrides liveKitOverrides, ConnectOptions connectOptions, SuspendFunction2<CoroutineScope, Room, Unit> onConnected, SuspendFunction2<CoroutineScope, Room, Unit> onDisconnected, Function2<Room, Exception, Unit> onError, Room passedRoom, Boolean disconnectOnDispose, Function1<Room, Unit> content)
Establishes a room scope which remembers a Room object which can be accessed through the RoomLocal composition local.
- Parameters:
url- the url of the livekit server to connect to.token- the token to connect to livekit with.audio- enable or disable audio.video- enable or disable video.connect- whether the room should connect to the server.roomOptions- options to pass to the Room.liveKitOverrides- overrides to pass to the Room.connectOptions- options to use when connecting.onConnected- a listener to be called upon room connection.onDisconnected- a listener to be called upon room disconnection.onError- a listener to be called upon room error.passedRoom- if a Room is provided, it will be used.disconnectOnDispose- by default, this composable handles the connection management and will disconnect the room when the composable goes out of scope.
-
requireRoom
@Composable() final static Room requireRoom(Room passedRoom)
Returns the passedRoom or the currently provided RoomLocal.
-
-
-
-