From 977629ab5910d0a5c875234a15ed3af8f0374e6a Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Sun, 21 May 2023 10:37:29 +0200 Subject: [PATCH] Log play exception --- ui/src/Room.tsx | 2 +- ui/src/Video.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/Room.tsx b/ui/src/Room.tsx index 52e0e5b3..e24dc35a 100644 --- a/ui/src/Room.tsx +++ b/ui/src/Room.tsx @@ -97,7 +97,7 @@ export const Room = ({ React.useEffect(() => { if (videoElement && stream) { videoElement.srcObject = stream; - videoElement.play(); + videoElement.play().catch((e) => console.log('Could not play main video', e)); } }, [videoElement, stream]); diff --git a/ui/src/Video.tsx b/ui/src/Video.tsx index 92a5b84e..422658d3 100644 --- a/ui/src/Video.tsx +++ b/ui/src/Video.tsx @@ -6,7 +6,7 @@ export const Video = ({src, className}: {src: MediaStream; className?: string}) React.useEffect(() => { if (element) { element.srcObject = src; - element.play(); + element.play().catch((e) => console.log('Could not play preview video', e)); } }, [element, src]);