MediaDeviceSelect
The MediaDeviceSelect list all media devices of one kind. Clicking on one of the listed devices make it the active media device.
Import
import { MediaDeviceSelect } from "@livekit/components-react";
Usage
<LiveKitRoom><MediaDeviceSelect kind="audioinput" /></LiveKitRoom>
Properties
kind
MediaDeviceKindRequiredexactMatch
booleanOptional(Optional) will force the browser to only return the specified device will call onDeviceSelectError with the error in case this fails
initialSelection
stringOptional(Optional)
onActiveDeviceChange
(deviceId: string) => voidOptional(Optional)
onDeviceListChange
(devices: MediaDeviceInfo[]) => voidOptional(Optional)
onDeviceSelectError
(e: Error) => voidOptional(Optional)
onError
(e: Error) => voidOptional(Optional)
requestPermissions
booleanOptional(Optional) this will call getUserMedia if the permissions are not yet given to enumerate the devices with device labels. in some browsers multiple calls to getUserMedia result in multiple permission prompts. It's generally advised only flip this to true, once a (preview) track has been acquired successfully with the appropriate permissions.
track
LocalAudioTrack | LocalVideoTrackOptional(Optional)