(feat): add basic call ui
(feat): add screensharing (incl. broken desktop picker) (qol): add todo
This commit is contained in:
parent
7b5cdca0ff
commit
fbd8ef4fa0
21 changed files with 1167 additions and 380 deletions
38
packages/call/src/components/videoViewer.tsx
Normal file
38
packages/call/src/components/videoViewer.tsx
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { VideoTrack, useParticipantTracks } from "@livekit/components-react";
|
||||
import { TrackPublication } from "livekit-client";
|
||||
import { useCall } from "../store";
|
||||
import { cn } from "@tensamin/ui";
|
||||
|
||||
export default function VideoViewer({
|
||||
className,
|
||||
flush = false,
|
||||
publication,
|
||||
participantId,
|
||||
}: {
|
||||
className?: string;
|
||||
flush?: boolean;
|
||||
publication: TrackPublication;
|
||||
participantId: string;
|
||||
}) {
|
||||
const room = useCall((state) => state.room);
|
||||
const tracks = useParticipantTracks([publication.source], {
|
||||
participantIdentity: participantId,
|
||||
room,
|
||||
});
|
||||
const trackRef = tracks[0];
|
||||
|
||||
if (!trackRef) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<VideoTrack
|
||||
trackRef={trackRef}
|
||||
className={cn(
|
||||
"w-full h-full aspect-video bg-black",
|
||||
flush ? "rounded-none" : "rounded-md",
|
||||
className,
|
||||
)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue