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
MediaDeviceKind
exactMatch?
boolean
(Optional) will force the browser to only return the specified device will call onDeviceSelectError
with the error in case this fails
initialSelection?
string
(Optional)
onActiveDeviceChange?
(deviceId: string) => void
(Optional)
onDeviceListChange?
(devices: MediaDeviceInfo[]) => void
(Optional)
onDeviceSelectError?
(e: Error) => void
(Optional)
onError?
(e: Error) => void
(Optional)
requestPermissions?
boolean
(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 | LocalVideoTrack
(Optional)