LiveKit LogoDocs
Real-timeEgress/IngressCloudReference

MediaDeviceMenu

The MediaDeviceMenu prefab component is a button that opens a menu that lists all media devices and allows the user to select them.

Import

import { MediaDeviceMenu } from '@livekit/components-react';

Remarks

This component is implemented with the MediaDeviceSelect LiveKit components.

Usage

<LiveKitRoom>
<MediaDeviceMenu />
</LiveKitRoom>

Properties

#
initialSelection?string

(Optional)

#
kind?MediaDeviceKind

(Optional)

#
onActiveDeviceChange?(kind: MediaDeviceKind, deviceId: string) => 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.

#
tracks?Partial<Record<MediaDeviceKind, LocalAudioTrack | LocalVideoTrack | undefined>>

(Optional)

On this page

ImportRemarksUsageProperties

Previous

Chevron IconLiveKitRoom
LiveKit logo

Product

SFU

SDKs

Performance

Deployment

GitHub Logo