simple huddle implementation with streams

This commit is contained in:
talksik
2026-04-01 08:50:56 -07:00
parent 0c340199e3
commit daa77c4e27
12 changed files with 252 additions and 65 deletions
+39
View File
@@ -0,0 +1,39 @@
import '@livekit/components-styles';
import { LiveKitRoom, VideoConference } from '@livekit/components-react';
import { useState, useEffect } from 'react';
export function HuddleApp() {
const [connection, setConnection] = useState<{ token: string; serverUrl: string } | null>(null);
useEffect(() => {
return window.electronHuddle.onConnect((data) => {
setConnection(data);
});
}, []);
const handleDisconnected = () => {
window.electronWindow.closeHuddle();
};
if (!connection) {
return (
<div className="flex h-screen items-center justify-center bg-background text-foreground">
<p className="text-muted-foreground text-sm">Connecting to huddle...</p>
</div>
);
}
return (
<LiveKitRoom
token={connection.token}
serverUrl={connection.serverUrl}
connect={true}
onDisconnected={handleDisconnected}
data-lk-theme="default"
style={{ height: '100vh' }}
>
<VideoConference />
</LiveKitRoom>
);
}