Timothy J. Baek 11 months ago
parent
commit
bd3e5d7bfa
1 changed files with 9 additions and 9 deletions
  1. 9 9
      src/lib/components/chat/MessageInput/CallOverlay.svelte

+ 9 - 9
src/lib/components/chat/MessageInput/CallOverlay.svelte

@@ -266,7 +266,6 @@
 					const imageUrl = takeScreenshot();
 
 					files = [
-						...files,
 						{
 							type: 'image',
 							url: imageUrl
@@ -318,16 +317,17 @@
 		const devices = await navigator.mediaDevices.enumerateDevices();
 		videoInputDevices = devices.filter((device) => device.kind === 'videoinput');
 
-		videoInputDevices = [
-			...videoInputDevices,
-			{
-				deviceId: 'screen',
-				label: 'Screen Share'
-			}
-		];
+		if (!!navigator.mediaDevices.getDisplayMedia) {
+			videoInputDevices = [
+				...videoInputDevices,
+				{
+					deviceId: 'screen',
+					label: 'Screen Share'
+				}
+			];
+		}
 
 		console.log(videoInputDevices);
-
 		if (selectedVideoInputDeviceId === null && videoInputDevices.length > 0) {
 			selectedVideoInputDeviceId = videoInputDevices[0].deviceId;
 		}