From c9b1c6592c6c895e338999675030183cfe9c8339 Mon Sep 17 00:00:00 2001 From: kaitlynkittyy Date: Tue, 9 Apr 2024 13:30:55 -0400 Subject: [PATCH] updated some stuff and fixed window resizing breaking streams --- src/renderer/components/ScreenSharePicker.tsx | 219 +++++++++--------- src/renderer/components/screenSharePicker.css | 19 +- src/renderer/patches/screenShareFixes.ts | 3 +- 3 files changed, 119 insertions(+), 122 deletions(-) diff --git a/src/renderer/components/ScreenSharePicker.tsx b/src/renderer/components/ScreenSharePicker.tsx index 6130747..3fbc98d 100644 --- a/src/renderer/components/ScreenSharePicker.tsx +++ b/src/renderer/components/ScreenSharePicker.tsx @@ -181,119 +181,123 @@ function StreamSettings({ deps: [source.id] } ); + const notVisible = false; + function setVisible() { + return !notVisible; + } // the source's name is not properly being displayed return ( -
-
- What you're streaming - - - {source.name} - -
-
- Stream Settings - -
-
- Resolution -
- {StreamResolutions.map(res => ( - - ))} -
-
- -
- Frame Rate -
- {StreamFps.map(fps => ( - - ))} -
-
-
+
+ What you're streaming + + Show Preview + + + stream preview + {source.name} + + Stream Settings + +
- Content Type -
-
-
- {isWindows && ( - setSettings(s => ({ ...s, audio: checked }))} - hideBorder - className="vcd-screen-picker-audio" - > - Stream With Audio - - )} - {isLinux && ( - setSettings(s => ({ ...s, audioSource: source }))} - setWorkaround={workaround => setSettings(s => ({ ...s, workaround: workaround }))} - /> - )} - -
+
+ Frame Rate +
+ {StreamFps.map(fps => ( + + ))} +
+
+
+
+ Content Type +
+
+ + +
+
+

+ Choosing "Prefer Clarity" will result in a significantly lower framerate in exchange for + a much sharper and clearer image. +

+
+
+
+ {isWindows && ( + setSettings(s => ({ ...s, audio: checked }))} + hideBorder + className="vcd-screen-picker-audio" + > + Stream With Audio + + )} + + {isLinux && ( + setSettings(s => ({ ...s, audioSource: source }))} + setWorkaround={workaround => setSettings(s => ({ ...s, workaround: workaround }))} + /> + )} +
); } @@ -381,13 +385,9 @@ function ModalComponent({ contentHint: "motion", audio: true }); - const newModalProps = { - ...modalProps, - size: "large" - }; return ( - + ScreenShare @@ -424,7 +424,8 @@ function ModalComponent({ const newConstraints = { ...constraints, frameRate, - advanced: [{ width: width, height: height }] + advanced: [{ width: width, height: height }], + resizeMode: "none" }; track.applyConstraints(newConstraints).then(() => { console.log("Applied constraints from ScreenSharePicker successfully."); diff --git a/src/renderer/components/screenSharePicker.css b/src/renderer/components/screenSharePicker.css index 6c78139..1ef60f2 100644 --- a/src/renderer/components/screenSharePicker.css +++ b/src/renderer/components/screenSharePicker.css @@ -1,13 +1,3 @@ -.vcd-screen-picker { - display: flex; - flex-direction: row; -} - -.vcd-screen-picker-content { - margin: 1em; - align-self: center; -} - .vcd-screen-picker-modal { padding: 1em; } @@ -139,6 +129,11 @@ width: 100%; font-weight: 400; } -.vcd-screen-picker-hints { - white-space: nowrap; + +.vcd-screen-picker-preview-switch { + margin-top: 1em; +} + +.not-visible { + display: none; } \ No newline at end of file diff --git a/src/renderer/patches/screenShareFixes.ts b/src/renderer/patches/screenShareFixes.ts index c66f366..d238a34 100644 --- a/src/renderer/patches/screenShareFixes.ts +++ b/src/renderer/patches/screenShareFixes.ts @@ -34,7 +34,8 @@ if (isLinux) { const newConstraints = { ...constraints, frameRate, - advanced: [{ width: width, height: height }] + advanced: [{ width: width, height: height }], + resizeMode: "none" }; track.applyConstraints(newConstraints).then(() => {