Add screenshare support (#138)

This commit is contained in:
Ben Cherry
2025-05-07 09:05:41 -07:00
committed by GitHub
parent 238857f368
commit c05ea63dae
4 changed files with 50 additions and 17 deletions

View File

@@ -6,29 +6,30 @@ import { Track } from "livekit-client";
type ConfigurationPanelItemProps = {
title: string;
children?: ReactNode;
deviceSelectorKind?: MediaDeviceKind;
source?: Track.Source;
};
export const ConfigurationPanelItem: React.FC<ConfigurationPanelItemProps> = ({
children,
title,
deviceSelectorKind,
source,
}) => {
return (
<div className="w-full text-gray-300 py-4 border-b border-b-gray-800 relative">
<div className="flex flex-row justify-between items-center px-4 text-xs uppercase tracking-wider">
<h3>{title}</h3>
{deviceSelectorKind && (
{source && (
<span className="flex flex-row gap-2">
<TrackToggle
className="px-2 py-1 bg-gray-900 text-gray-300 border border-gray-800 rounded-sm hover:bg-gray-800"
source={
deviceSelectorKind === "audioinput"
? Track.Source.Microphone
: Track.Source.Camera
}
source={source}
/>
<PlaygroundDeviceSelector kind={deviceSelectorKind} />
{source === Track.Source.Camera && (
<PlaygroundDeviceSelector kind="videoinput" />
)}
{source === Track.Source.Microphone && (
<PlaygroundDeviceSelector kind="audioinput" />
)}
</span>
)}
</div>