From d888b694ccd700e5a0009a53e663c0d65e770c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Tue, 15 Jun 2021 17:30:28 +0200 Subject: [PATCH] Adding button to change layout --- front/src/Components/CameraControls.svelte | 17 ++++++++++ front/src/Components/Video/ChatLayout.svelte | 30 +++++++++++++++++ .../Video/PresentationLayout.svelte | 20 ++++++++++++ .../src/Components/Video/VideoOverlay.svelte | 32 ++++++------------- front/src/Stores/LayoutStore.ts | 13 +++----- front/style/style.scss | 12 ++++++- 6 files changed, 92 insertions(+), 32 deletions(-) create mode 100644 front/src/Components/Video/ChatLayout.svelte create mode 100644 front/src/Components/Video/PresentationLayout.svelte diff --git a/front/src/Components/CameraControls.svelte b/front/src/Components/CameraControls.svelte index 5c17a9fe..17440a65 100644 --- a/front/src/Components/CameraControls.svelte +++ b/front/src/Components/CameraControls.svelte @@ -7,6 +7,9 @@ import cinemaCloseImg from "./images/cinema-close.svg"; import microphoneImg from "./images/microphone.svg"; import microphoneCloseImg from "./images/microphone-close.svg"; + import {layoutModeStore} from "../Stores/LayoutStore"; + import {LayoutMode} from "../WebRtc/LayoutManager"; + import {peerStore} from "../Stores/PeerStore"; function screenSharingClick(): void { if ($requestedScreenSharingState === true) { @@ -32,10 +35,24 @@ } } + function switchLayoutMode() { + if ($layoutModeStore === LayoutMode.Presentation) { + $layoutModeStore = LayoutMode.VideoChat; + } else { + $layoutModeStore = LayoutMode.Presentation; + } + }
+
+ {#if $layoutModeStore === LayoutMode.Presentation } + Switch to mosaic mode + {:else} + Switch to presentation mode + {/if} +
{#if $requestedScreenSharingState} Start screen sharing diff --git a/front/src/Components/Video/ChatLayout.svelte b/front/src/Components/Video/ChatLayout.svelte new file mode 100644 index 00000000..bab13d66 --- /dev/null +++ b/front/src/Components/Video/ChatLayout.svelte @@ -0,0 +1,30 @@ + + +
+ {#each [...$layoutStore.values()] as peer (peer.uniqueId)} + + {/each} +
diff --git a/front/src/Components/Video/PresentationLayout.svelte b/front/src/Components/Video/PresentationLayout.svelte new file mode 100644 index 00000000..f7ac5802 --- /dev/null +++ b/front/src/Components/Video/PresentationLayout.svelte @@ -0,0 +1,20 @@ + + +
+ {#each [...$layoutStore.values()] as peer (peer.uniqueId)} + {#if $videoFocusStore && peer === $videoFocusStore } + + {/if} + {/each} +
+ diff --git a/front/src/Components/Video/VideoOverlay.svelte b/front/src/Components/Video/VideoOverlay.svelte index 88c1cd42..0190fd49 100644 --- a/front/src/Components/Video/VideoOverlay.svelte +++ b/front/src/Components/Video/VideoOverlay.svelte @@ -1,31 +1,17 @@
-
- {#each [...$layoutStore.values()] as peer (peer.uniqueId)} - {#if $videoFocusStore && peer === $videoFocusStore } - - {/if} - {/each} -
- - - - + {#if $layoutModeStore === LayoutMode.Presentation } + + {:else } + + {/if}