diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index b2435e8..954787e 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -138,6 +138,8 @@ export function InCallView({ token, serverUrl: "ws://localhost:7880", room: livekitRoom, + audio: true, + video: true, onConnected: () => { console.log("connected to LiveKit room"); }, diff --git a/src/video-grid/VideoTile.tsx b/src/video-grid/VideoTile.tsx index 8ca5ac9..0b8cfb3 100644 --- a/src/video-grid/VideoTile.tsx +++ b/src/video-grid/VideoTile.tsx @@ -19,7 +19,7 @@ import { animated } from "@react-spring/web"; import classNames from "classnames"; import { useTranslation } from "react-i18next"; import { LocalParticipant, RemoteParticipant, Track } from "livekit-client"; -import { useMediaTrack } from "@livekit/components-react"; +import { VideoTrack, useMediaTrack } from "@livekit/components-react"; import styles from "./VideoTile.module.css"; import { ReactComponent as MicMutedIcon } from "../icons/MicMuted.svg"; @@ -28,24 +28,14 @@ import { ReactComponent as VideoMutedIcon } from "../icons/VideoMuted.svg"; interface Props { name: string; avatar?: JSX.Element; - maximised?: boolean; className?: string; sfuParticipant: LocalParticipant | RemoteParticipant; } export const VideoTile = forwardRef( - ({ name, avatar, maximised, className, sfuParticipant, ...rest }, ref) => { + ({ name, avatar, className, sfuParticipant, ...rest }, ref) => { const { t } = useTranslation(); - const videoEl = React.useRef(null); - const { isMuted: cameraMuted } = useMediaTrack( - Track.Source.Camera, - sfuParticipant, - { - element: videoEl, - } - ); - const audioEl = React.useRef(null); const { isMuted: microphoneMuted } = useMediaTrack( Track.Source.Microphone, @@ -62,18 +52,18 @@ export const VideoTile = forwardRef( [styles.speaking]: sfuParticipant.isSpeaking, [styles.muted]: microphoneMuted, [styles.screenshare]: false, - [styles.maximised]: maximised, + [styles.maximised]: false, })} ref={ref} {...rest} > - {cameraMuted && ( + {!sfuParticipant.isCameraEnabled && ( <>
{avatar} )} - {!maximised && + {!false && (sfuParticipant.isScreenShareEnabled ? (
{t("{{name}} is presenting", { name })} @@ -86,13 +76,13 @@ export const VideoTile = forwardRef( aren't quite real-time, so this is an important kludge to make sure no one appears muted when they've clearly begun talking. */ microphoneMuted && - !cameraMuted && + sfuParticipant.isCameraEnabled && !sfuParticipant.isSpeaking && } - {cameraMuted && } + {!sfuParticipant.isCameraEnabled && }
))} -