From 4766bbb890d3eec3890d21aab4780e361afc0bf4 Mon Sep 17 00:00:00 2001 From: Sondre Olsen <35999713+sondreo@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:20:39 +0200 Subject: [PATCH] Add muted attribute to video player --- frontend/src/components/Contexts/MediaStreamContext.tsx | 5 ++--- .../MissionPage/VideoStream/VideoPlayerSimpleStream.tsx | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Contexts/MediaStreamContext.tsx b/frontend/src/components/Contexts/MediaStreamContext.tsx index 8d835745b..a7d31ce07 100644 --- a/frontend/src/components/Contexts/MediaStreamContext.tsx +++ b/frontend/src/components/Contexts/MediaStreamContext.tsx @@ -61,12 +61,11 @@ export const MediaStreamProvider: FC = ({ children }) => { ) { addTrackToConnection(track.mediaStreamTrack, config.robotId) } - if (room.state == ConnectionState.Disconnected) { + if (room.state === ConnectionState.Disconnected) { room.connect(config.url, config.token) .then(() => console.log(JSON.stringify(room.state))) - .catch((error) => console.log('Error connecting to LiveKit room')) + .catch((error) => console.warn('Error connecting to LiveKit Room, may already be connected:', error)) } - console.log(JSON.stringify(room.numParticipants)) } const createMediaConnection = async (config: MediaStreamConfig) => { diff --git a/frontend/src/components/Pages/MissionPage/VideoStream/VideoPlayerSimpleStream.tsx b/frontend/src/components/Pages/MissionPage/VideoStream/VideoPlayerSimpleStream.tsx index 3c9f56170..43763ac3d 100644 --- a/frontend/src/components/Pages/MissionPage/VideoStream/VideoPlayerSimpleStream.tsx +++ b/frontend/src/components/Pages/MissionPage/VideoStream/VideoPlayerSimpleStream.tsx @@ -6,6 +6,7 @@ interface IVideoPlayerProps { export const VideoPlayerSimpleStream = ({ videoStream, videoStreamName }: IVideoPlayerProps) => (