diff --git a/public/images/loading.gif b/public/images/loading.gif new file mode 100644 index 00000000..8586d86e Binary files /dev/null and b/public/images/loading.gif differ diff --git a/public/js/LocalStorage.js b/public/js/LocalStorage.js index 618fda17..6095fb00 100644 --- a/public/js/LocalStorage.js +++ b/public/js/LocalStorage.js @@ -16,12 +16,13 @@ class LocalStorage { }; this.SFU_SETTINGS = { - show_chat_on_msg: true, + share_on_join: true, // popup message on join + show_chat_on_msg: true, // show chat on new message video_fps: 0, // default 1280x768 30fps screen_fps: 0, // max 30fps - lobby: false, - pitch_bar: true, - sounds: true, + lobby: false, // default false + pitch_bar: true, // volume indicator + sounds: true, // room notify sounds video_obj_fit: 2, // cover video_controls: 0, // off theme: 0, // dark diff --git a/public/js/Room.js b/public/js/Room.js index 05cb5eba..580bab3a 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -60,6 +60,7 @@ const lS = new LocalStorage(); // Get Settings from localStorage const localStorageSettings = lS.getObjectLocalStorage('SFU_SETTINGS'); const lsSettings = localStorageSettings ? localStorageSettings : lS.SFU_SETTINGS; +console.log('LS_SETTINGS', lsSettings); // #################################################### // DYNAMIC SETTINGS @@ -175,6 +176,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('roomId', 'Room name', 'right'); setTippy('sessionTime', 'Session time', 'right'); setTippy('whiteboardGhostButton', 'Toggle transparent background', 'bottom'); @@ -461,8 +463,9 @@ function getNotify() { return queryNotify; } } - console.log('Direct join', { notify: true }); - return true; + notify = lsSettings.share_on_join; + console.log('Direct join', { notify: notify }); + return notify; } function isPeerPresenter() { @@ -1492,6 +1495,13 @@ function handleSelects() { lS.setSettings(lsSettings); e.target.blur(); }; + switchShare.onchange = (e) => { + notify = e.currentTarget.checked; + rc.roomMessage('notify', notify); + lsSettings.share_on_join = notify; + lS.setSettings(lsSettings); + e.target.blur(); + }; // styling BtnAspectRatio.onchange = () => { setAspectRatio(BtnAspectRatio.value); @@ -1608,6 +1618,7 @@ function loadSettingsFromLocalStorage() { showChatOnMsg.checked = rc.showChatOnMessage; switchPitchBar.checked = isPitchBarEnabled; switchSounds.checked = isSoundEnabled; + switchShare.checked = notify; videoFps.selectedIndex = lsSettings.video_fps; screenFps.selectedIndex = lsSettings.screen_fps; BtnVideoObjectFit.selectedIndex = lsSettings.video_obj_fit; diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index cf84216f..79d08ccb 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -42,6 +42,7 @@ const html = { }; const icons = { + share: '', ptt: '', lobby: '', lock: '', @@ -4031,6 +4032,10 @@ class RoomClient { this.sound('switch'); this.userLog('info', `${icons.ptt} Push to talk ${status}`, 'top-end'); break; + case 'notify': + this.sound('switch'); + this.userLog('info', `${icons.share} Share room on join enabled ${status}`, 'top-end'); + break; default: break; } diff --git a/public/views/Room.html b/public/views/Room.html index ac2a3acc..9482f1f7 100644 --- a/public/views/Room.html +++ b/public/views/Room.html @@ -87,7 +87,7 @@

Loading

- +
 Please allow the camera or microphone
 access to use this app.
@@ -245,6 +245,19 @@ access to use this app.
                                     
+ + +
+ +

Share

+
+ + +
+ +
+ +