Explicitly configure options for the LiveKit room

This commit is contained in:
Daniel Abramov
2023-06-09 19:04:46 +02:00
parent 28fe813b76
commit 048dce05c3
2 changed files with 47 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import {
import { MediaDevicesState, MediaDevices } from "../settings/mediaDevices";
import { LocalMediaInfo, MediaInfo } from "../room/VideoPreview";
import { roomOptions } from "./options";
type LiveKitState = {
// The state of the media devices (changing the devices will also change them in the room).
@@ -25,7 +26,7 @@ type LiveKitState = {
export function useLiveKit(): LiveKitState | undefined {
// TODO: Pass the proper paramters to configure the room (supported codecs, simulcast, adaptive streaming, etc).
const [room] = React.useState<Room>(() => {
return new Room();
return new Room(roomOptions);
});
// Create a React state to store the available devices and the selected device for each kind.