TrackToggle
With the TrackToggle
component it is possible to mute and unmute your camera and microphone. The component uses an html button element under the hood so you can treat it like a button.
Import
import { TrackToggle } from "@livekit/components-react";
Usage
<LiveKitRoom><TrackToggle source={Track.Source.Microphone} /><TrackToggle source={Track.Source.Camera} /></LiveKitRoom>
Properties
source
T
captureOptions?
CaptureOptionsBySource<T>
(Optional)
initialState?
boolean
(Optional)
onChange?
(enabled: boolean, isUserInitiated: boolean) => void
(Optional) Function that is called when the enabled state of the toggle changes. The second function argument isUserInitiated
is true
if the change was initiated by a user interaction, such as a click.
onDeviceError?
(error: Error) => void
(Optional)
publishOptions?
TrackPublishOptions
(Optional)
showIcon?
boolean
(Optional)