From 0fd2260ac7a69f17b1ef91471fb04a6e3ccf9160 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Thu, 9 Jan 2025 23:40:45 +0100 Subject: [PATCH] [mirotalk] - update config, improvements, update dep --- app/src/config.template.js | 1 + app/src/server.js | 2 +- package.json | 4 +- public/js/buttons.js | 6 +-- public/js/client.js | 24 ++++++++---- public/js/config.js | 76 -------------------------------------- public/views/client.html | 4 +- 7 files changed, 25 insertions(+), 92 deletions(-) delete mode 100644 public/js/config.js diff --git a/app/src/config.template.js b/app/src/config.template.js index 41b6d9b3e..4c188d7d4 100644 --- a/app/src/config.template.js +++ b/app/src/config.template.js @@ -81,6 +81,7 @@ module.exports = { showEjectEveryoneBtn: true, showLockRoomBtn: true, showUnlockRoomBtn: true, + showShortcutsBtn: true, }, remote: { showAudioVolume: true, diff --git a/app/src/server.js b/app/src/server.js index b26f81a77..3329f88db 100755 --- a/app/src/server.js +++ b/app/src/server.js @@ -39,7 +39,7 @@ dependencies: { * @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.4.38 + * @version 1.4.39 * */ diff --git a/package.json b/package.json index 884da8185..8f9e796cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalk", - "version": "1.4.38", + "version": "1.4.39", "description": "A free WebRTC browser-based video call", "main": "server.js", "scripts": { @@ -55,7 +55,7 @@ "js-yaml": "^4.1.0", "ngrok": "^5.0.0-beta.2", "nodemailer": "^6.9.16", - "openai": "^4.77.3", + "openai": "^4.78.0", "qs": "^6.13.1", "socket.io": "^4.8.1", "swagger-ui-express": "^5.0.1", diff --git a/public/js/buttons.js b/public/js/buttons.js index 49182dd98..6837b9bdb 100644 --- a/public/js/buttons.js +++ b/public/js/buttons.js @@ -7,7 +7,7 @@ */ let buttons = { main: { - showShareRoomBtn: true, + showShareRoomBtn: true, // For guests showHideMeBtn: true, showAudioBtn: true, showVideoBtn: true, @@ -20,7 +20,6 @@ let buttons = { showWhiteboardBtn: true, showSnapshotRoomBtn: true, showFileShareBtn: true, - showDocumentPipBtn: showDocumentPipBtn, showMySettingsBtn: true, showAboutBtn: true, // Please keep me always true, Thank you! }, @@ -50,6 +49,7 @@ let buttons = { showEjectEveryoneBtn: true, showLockRoomBtn: true, showUnlockRoomBtn: true, + showShortcutsBtn: true, }, remote: { showAudioVolume: true, @@ -62,13 +62,11 @@ let buttons = { showPrivateMessageBtn: true, showZoomInOutBtn: false, showVideoFocusBtn: true, - showVideoPipBtn: showVideoPipBtn, }, local: { showSnapShotBtn: true, showVideoCircleBtn: true, showZoomInOutBtn: false, - showVideoPipBtn: showVideoPipBtn, }, whiteboard: { whiteboardLockBtn: false, diff --git a/public/js/client.js b/public/js/client.js index 881eb5457..9f270fd3a 100644 --- a/public/js/client.js +++ b/public/js/client.js @@ -15,7 +15,7 @@ * @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.4.38 + * @version 1.4.39 * */ @@ -5630,14 +5630,12 @@ function setupMySettings() { }); // handle Shortcuts - if (!isDesktopDevice) { + if (!isDesktopDevice || !buttons.settings.showShortcutsBtn) { elemDisplay(tabShortcutsBtn, false); + setKeyboardShortcuts(false); } else { switchShortcuts.addEventListener('change', (e) => { - isShortcutsEnabled = e.currentTarget.checked; - lsSettings.keyboard_shortcuts = isShortcutsEnabled; - lS.setSettings(lsSettings); - const status = isShortcutsEnabled ? 'enabled' : 'disabled'; + const status = setKeyboardShortcuts(e.currentTarget.checked); userLog('toast', `Keyboard shortcuts ${status}`); playSound('switch'); }); @@ -5697,6 +5695,18 @@ function setupMySettings() { } } +/** + * Set Keyboard Shortcuts enabled + * @param {boolean} enabled + * @return {String} enabled/disabled + */ +function setKeyboardShortcuts(enabled){ + isShortcutsEnabled = enabled; + lsSettings.keyboard_shortcuts = isShortcutsEnabled; + lS.setSettings(lsSettings); + return isShortcutsEnabled ? 'enabled' : 'disabled'; +} + /** * Load settings from local storage */ @@ -10918,7 +10928,7 @@ function showAbout() { Swal.fire({ background: swBg, position: 'center', - title: 'WebRTC P2P v1.4.38', + title: 'WebRTC P2P v1.4.39', imageAlt: 'mirotalk-about', imageUrl: images.about, customClass: { image: 'img-about' }, diff --git a/public/js/config.js b/public/js/config.js deleted file mode 100644 index 623818197..000000000 --- a/public/js/config.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -/** - * Configuration for controlling the visibility of buttons in the MiroTalk P2P client. - * Set properties to true to show the corresponding buttons, or false to hide them. - * captionBtn, showSwapCameraBtn, showScreenShareBtn, showFullScreenBtn, showVideoPipBtn, showDocumentPipBtn -> (auto-detected). - */ -const buttons = { - main: { - showShareRoomBtn: true, - showHideMeBtn: true, - showAudioBtn: true, - showVideoBtn: true, - showScreenBtn: true, - showRecordStreamBtn: true, - showChatRoomBtn: true, - showCaptionRoomBtn: true, - showRoomEmojiPickerBtn: true, - showMyHandBtn: true, - showWhiteboardBtn: true, - showSnapshotRoomBtn: true, - showFileShareBtn: true, - showDocumentPipBtn: showDocumentPipBtn, - showMySettingsBtn: true, - showAboutBtn: true, // Please keep me always true, Thank you! - }, - chat: { - showTogglePinBtn: true, - showMaxBtn: true, - showSaveMessageBtn: true, - showMarkDownBtn: true, - showChatGPTBtn: true, - showFileShareBtn: true, - showShareVideoAudioBtn: true, - showParticipantsBtn: true, - }, - caption: { - showTogglePinBtn: true, - showMaxBtn: true, - }, - settings: { - showMicOptionsBtn: true, - showTabRoomPeerName: true, - showTabRoomParticipants: true, - showTabRoomSecurity: true, - showTabEmailInvitation: true, - showCaptionEveryoneBtn: true, - showMuteEveryoneBtn: true, - showHideEveryoneBtn: true, - showEjectEveryoneBtn: true, - showLockRoomBtn: true, - showUnlockRoomBtn: true, - }, - remote: { - showAudioVolume: true, - audioBtnClickAllowed: true, - videoBtnClickAllowed: true, - showKickOutBtn: true, - showSnapShotBtn: true, - showFileShareBtn: true, - showShareVideoAudioBtn: true, - showPrivateMessageBtn: true, - showZoomInOutBtn: false, - showVideoFocusBtn: true, - showVideoPipBtn: showVideoPipBtn, - }, - local: { - showSnapShotBtn: true, - showVideoCircleBtn: true, - showZoomInOutBtn: false, - showVideoPipBtn: showVideoPipBtn, - }, - whiteboard: { - whiteboardLockBtn: false, - }, -}; diff --git a/public/views/client.html b/public/views/client.html index ca16f308d..b3e5dcafb 100755 --- a/public/views/client.html +++ b/public/views/client.html @@ -1143,12 +1143,12 @@

Loading

- + + -