diff --git a/public/css/Room.css b/public/css/Room.css index b6c5be3b..a5831609 100644 --- a/public/css/Room.css +++ b/public/css/Room.css @@ -64,9 +64,8 @@ --btns-width: 320px; --btns-flex-direction: row; */ - /* - https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit - */ + --vmi-wh: 15vw; + /* https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit */ --videoObjFit: cover; } @@ -186,7 +185,7 @@ body { position: absolute; margin: auto; padding: 10px; - min-width: 320px; + width: 370px; min-height: 480px; background: var(--settings-bg); box-shadow: var(--box-shadow); @@ -209,7 +208,7 @@ body { #mySettings select { width: auto; - max-width: 270px; + max-width: 320px; height: 40px; color: #fff; background-color: transparent; diff --git a/public/css/VideoGrid.css b/public/css/VideoGrid.css index 4c8aa896..56ae0118 100644 --- a/public/css/VideoGrid.css +++ b/public/css/VideoGrid.css @@ -7,8 +7,8 @@ position: absolute; display: flex; top: 0; - height: 100%; width: 100%; + height: 100%; border-radius: 5px; align-content: center; flex-wrap: wrap; @@ -16,6 +16,7 @@ justify-content: center; vertical-align: middle; overflow: hidden; + /* border: 3px solid blue; */ } #videoPinMediaContainer { @@ -24,8 +25,8 @@ display: none; top: 0; left: 0; - height: 100%; width: 75%; + height: 100%; border-radius: 5px; box-shadow: var(--box-shadow); overflow: hidden; @@ -107,8 +108,8 @@ #videoMediaContainer img { position: absolute; display: none; - width: 15vw; - height: 15vw; + width: var(--vmi-wh); + height: var(--vmi-wh); } .videoMenuBar { diff --git a/public/js/Room.js b/public/js/Room.js index 1061e206..46ae685e 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -130,6 +130,7 @@ function initClient() { setTippy('tabVideoShareBtn', 'Video share', 'top'); setTippy('tabAspectBtn', 'Aspect', 'top'); setTippy('tabStylingBtn', 'Styling', 'top'); + setTippy('tabLanguagesBtn', 'Languages', 'top'); setTippy('whiteboardGhostButton', 'Toggle transparent background', 'bottom'); setTippy('wbBackgroundColorEl', 'Background color', 'bottom'); setTippy('wbDrawingColorEl', 'Drawing color', 'bottom'); @@ -672,6 +673,7 @@ function roomIsReady() { BUTTONS.settings.participantsButton && show(participantsButton); BUTTONS.settings.lockRoomButton && show(lockRoomButton); BUTTONS.main.aboutButton && show(aboutButton); + if (!DetectRTC.isMobileDevice) show(pinUnpinGridDiv); handleButtons(); handleSelects(); handleInputs(); @@ -801,6 +803,9 @@ function handleButtons() { tabStylingBtn.onclick = (e) => { rc.openTab(e, 'tabStyling'); }; + tabLanguagesBtn.onclick = (e) => { + rc.openTab(e, 'tabLanguages'); + }; chatButton.onclick = () => { rc.toggleChat(); }; @@ -1016,6 +1021,9 @@ function handleSelects() { BtnsBarPosition.onchange = () => { rc.changeBtnsBarPosition(BtnsBarPosition.value); }; + pinVideoPosition.onchange = () => { + rc.togglePin(pinVideoPosition.value); + }; // whiteboard options wbDrawingColorEl.onchange = () => { diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index 819fc661..d2cf1699 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -1539,25 +1539,6 @@ class RoomClient { } } - // #################################################### - // REMOVE VIDEO PIN MEDIA CONTAINER - // #################################################### - - removeVideoPinMediaContainer() { - this.videoPinMediaContainer.style.display = 'none'; - this.videoMediaContainer.style.width = '100%'; - this.videoMediaContainer.style.right = null; - this.videoMediaContainer.style.left = 0; - this.pinnedVideoPlayerId = null; - this.isVideoPinned = false; - } - - adaptVideoObjectFit(index) { - // 1 (cover) 2 (contain) - BtnVideoObjectFit.selectedIndex = index; - BtnVideoObjectFit.onchange(); - } - // #################################################### // SHARE SCREEN ON JOIN // #################################################### @@ -1979,7 +1960,7 @@ class RoomClient { } // #################################################### - // HANDLE VIDEO | OBJ FIT | CONTROLS | + // HANDLE VIDEO | OBJ FIT | CONTROLS | PIN-UNPIN // #################################################### handleVideoObjectFit(value) { @@ -2010,9 +1991,7 @@ class RoomClient { cam.className = ''; cam.style.width = '100%'; cam.style.height = '100%'; - this.videoMediaContainer.style.width = '25%'; - this.videoMediaContainer.style.left = null; - this.videoMediaContainer.style.right = 0; + this.togglePin(pinVideoPosition.value); this.videoPinMediaContainer.appendChild(cam); this.videoPinMediaContainer.style.display = 'block'; this.pinnedVideoPlayerId = elemId; @@ -2025,12 +2004,8 @@ class RoomClient { if (!isScreen) videoPlayer.style.objectFit = 'var(--videoObjFit)'; this.videoPinMediaContainer.removeChild(cam); cam.className = 'Camera'; - this.videoMediaContainer.style.width = '100%'; - this.videoMediaContainer.style.right = null; - this.videoMediaContainer.style.left = 0; this.videoMediaContainer.appendChild(cam); - this.videoPinMediaContainer.style.display = 'none'; - this.pinnedVideoPlayerId = null; + this.removeVideoPinMediaContainer(); setColor(btnPn, 'white'); } handleAspectRatio(); @@ -2038,6 +2013,52 @@ class RoomClient { } } + togglePin(position) { + if (!this.isVideoPinned) return; + switch (position) { + case 'vertical': + this.videoPinMediaContainer.style.width = '75%'; + this.videoPinMediaContainer.style.height = '100%'; + this.videoMediaContainer.style.top = 0; + this.videoMediaContainer.style.width = '25%'; + this.videoMediaContainer.style.height = '100%'; + this.videoMediaContainer.style.right = 0; + document.documentElement.style.setProperty('--vmi-wh', '15vw'); + break; + case 'horizontal': + this.videoPinMediaContainer.style.width = '100%'; + this.videoPinMediaContainer.style.height = '75%'; + this.videoMediaContainer.style.top = '75%'; + this.videoMediaContainer.style.right = null; + this.videoMediaContainer.style.width = null; + this.videoMediaContainer.style.width = '100% !important'; + this.videoMediaContainer.style.height = '25%'; + document.documentElement.style.setProperty('--vmi-wh', '15vh'); + break; + } + resizeVideoMedia(); + } + + // #################################################### + // REMOVE VIDEO PIN MEDIA CONTAINER + // #################################################### + + removeVideoPinMediaContainer() { + this.videoPinMediaContainer.style.display = 'none'; + this.videoMediaContainer.style.top = 0; + this.videoMediaContainer.style.right = null; + this.videoMediaContainer.style.width = '100%'; + this.videoMediaContainer.style.height = '100%'; + this.pinnedVideoPlayerId = null; + this.isVideoPinned = false; + } + + adaptVideoObjectFit(index) { + // 1 (cover) 2 (contain) + BtnVideoObjectFit.selectedIndex = index; + BtnVideoObjectFit.onchange(); + } + // #################################################### // TAKE SNAPSHOT // #################################################### diff --git a/public/views/Room.html b/public/views/Room.html index 6a8fc4bf..b172ce3d 100644 --- a/public/views/Room.html +++ b/public/views/Room.html @@ -125,6 +125,7 @@ +
@@ -271,6 +272,18 @@ +
+ +
+ +

Language: