From 52dbc9b9537b84113336fc204e87fba9774d24c8 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Tue, 7 Jan 2025 14:24:12 +0100 Subject: [PATCH] [mirotalksfu] - add keep buttons --- app/src/Server.js | 2 +- package.json | 4 ++-- public/js/LocalStorage.js | 1 + public/js/Room.js | 38 ++++++++++++++++++++++++++++++++------ public/js/RoomClient.js | 2 +- public/views/Room.html | 13 +++++++++++++ 6 files changed, 50 insertions(+), 10 deletions(-) diff --git a/app/src/Server.js b/app/src/Server.js index dd000fd2..427e5b2b 100644 --- a/app/src/Server.js +++ b/app/src/Server.js @@ -55,7 +55,7 @@ dev dependencies: { * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.6.85 + * @version 1.6.86 * */ diff --git a/package.json b/package.json index c3f0f0d5..b3e2c6e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalksfu", - "version": "1.6.85", + "version": "1.6.86", "description": "WebRTC SFU browser-based video calls", "main": "Server.js", "scripts": { @@ -58,7 +58,7 @@ }, "dependencies": { "@mattermost/client": "^10.2.0", - "@sentry/node": "^8.47.0", + "@sentry/node": "^8.48.0", "axios": "^1.7.9", "colors": "1.4.0", "compression": "1.7.5", diff --git a/public/js/LocalStorage.js b/public/js/LocalStorage.js index c52fdd0d..9902d368 100644 --- a/public/js/LocalStorage.js +++ b/public/js/LocalStorage.js @@ -44,6 +44,7 @@ class LocalStorage { lobby: false, // default false pitch_bar: true, // volume indicator sounds: true, // room notify sounds + keep_buttons_visible: false, // Keep buttons always visible host_only_recording: false, // presenter rec_prioritize_h264: false, // Prioritize h.264 with AAC or h.264 with Opus codecs over VP8 with Opus or VP9 with Opus codecs rec_server: false, // The recording will be stored on the server rather than locally diff --git a/public/js/Room.js b/public/js/Room.js index 43d5c5f8..e82a267e 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.6.85 + * @version 1.6.86 * */ @@ -206,6 +206,7 @@ let isPushToTalkActive = false; let isSpaceDown = false; let isPitchBarEnabled = true; let isSoundEnabled = true; +let isKeepButtonsVisible = false; let isBroadcastingEnabled = false; let isLobbyEnabled = false; let isLobbyOpen = false; @@ -300,6 +301,7 @@ function initClient() { setTippy('switchPitchBar', 'Toggle audio pitch bar', 'right'); setTippy('switchSounds', 'Toggle the sounds notifications', 'right'); setTippy('switchShare', "Show 'Share Room' popup on join", 'right'); + setTippy('switchKeepButtonsVisible', 'Keep buttons always visible', 'right'); setTippy('roomId', 'Room name (click to copy)', 'right'); setTippy('sessionTime', 'Session time', 'right'); setTippy('recordingImage', 'Toggle recording', 'right'); @@ -2513,6 +2515,15 @@ function handleSelects() { lS.setSettings(localStorageSettings); e.target.blur(); }; + switchKeepButtonsVisible.onchange = (e) => { + isButtonsBarOver = isKeepButtonsVisible = e.currentTarget.checked; + localStorageSettings.keep_buttons_visible = isButtonsBarOver; + lS.setSettings(localStorageSettings); + checkButtonsBar(); + const status = isButtonsBarOver ? 'enabled' : 'disabled'; + userLog('info', `Buttons always visible ${status}`, 'top-end'); + e.target.blur(); + }; // audio options switchAutoGainControl.onchange = (e) => { localStorageSettings.mic_auto_gain_control = e.currentTarget.checked; @@ -2954,12 +2965,14 @@ function loadSettingsFromLocalStorage() { rc.speechInMessages = localStorageSettings.speech_in_msg; isPitchBarEnabled = localStorageSettings.pitch_bar; isSoundEnabled = localStorageSettings.sounds; + isKeepButtonsVisible = localStorageSettings.keep_buttons_visible; showChatOnMsg.checked = rc.showChatOnMessage; transcriptShowOnMsg.checked = transcription.showOnMessage; speechIncomingMsg.checked = rc.speechInMessages; switchPitchBar.checked = isPitchBarEnabled; switchSounds.checked = isSoundEnabled; switchShare.checked = notify; + switchKeepButtonsVisible.checked = isKeepButtonsVisible; recPrioritizeH264 = localStorageSettings.rec_prioritize_h264; switchH264Recording.checked = recPrioritizeH264; @@ -3337,12 +3350,25 @@ function showButtons() { } function checkButtonsBar() { - if (!isButtonsBarOver) { - control.style.display = 'none'; + if (localStorageSettings.keep_buttons_visible) { + control.style.display = 'flex'; toggleExtraButton.innerHTML = icons.up; - bottomButtons.style.display = 'none'; - isButtonsVisible = false; + bottomButtons.style.display = 'flex'; + isButtonsVisible = true; + } else { + if (!isButtonsBarOver) { + control.style.display = 'none'; + toggleExtraButton.innerHTML = icons.up; + bottomButtons.style.display = 'none'; + isButtonsVisible = false; + } } + // if (!isButtonsBarOver) { + // control.style.display = 'none'; + // toggleExtraButton.innerHTML = icons.up; + // bottomButtons.style.display = 'none'; + // isButtonsVisible = false; + // } setTimeout(() => { checkButtonsBar(); }, 10000); @@ -4676,7 +4702,7 @@ function showAbout() { imageUrl: image.about, customClass: { image: 'img-about' }, position: 'center', - title: 'WebRTC SFU v1.6.85', + title: 'WebRTC SFU v1.6.86', html: `
diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index 767e29fe..20c9cffc 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -9,7 +9,7 @@ * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.6.85 + * @version 1.6.86 * */ diff --git a/public/views/Room.html b/public/views/Room.html index a23561a6..f13e1a4f 100644 --- a/public/views/Room.html +++ b/public/views/Room.html @@ -351,6 +351,19 @@ access to use this app.
+ + +
+ +

Buttons

+
+ + +
+ +
+ +