LiveKit LogoDocs
Real-timeEgress/IngressCloudReference

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

#
kindMediaDeviceKind

#
exactMatch?boolean

(Optional) will force the browser to only return the specified device will call onDeviceSelectError with the error in case this fails

(Optional)

#
onActiveDeviceChange?(deviceId: string) => void

(Optional)

#
onDeviceListChange?(devices: MediaDeviceInfo[]) => void

(Optional)

#
onDeviceSelectError?(e: Error) => void

(Optional)

(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)

On this page

ImportUsageProperties

Previous

Chevron IconMediaDeviceMenu
LiveKit logo

Product

SFU

SDKs

Performance

Deployment

GitHub Logo