From afe88a3a5ef1b7b55c7f1f041e2d8c98ca7787a0 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Fri, 3 May 2024 17:06:09 +0200 Subject: [PATCH] [mirotalksfu] - improvements --- public/js/Room.js | 43 ++++++++++++++++++++++++++++++++++++++++++ public/views/Room.html | 38 +++++++++---------------------------- 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/public/js/Room.js b/public/js/Room.js index 9aec2042..94129447 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -248,6 +248,10 @@ let transcription; // INIT ROOM // #################################################### +document.addEventListener('DOMContentLoaded', function () { + initClient(); +}); + function initClient() { setTheme(); @@ -344,6 +348,7 @@ function initClient() { } setupWhiteboard(); initEnumerateDevices(); + setupInitButtons(); } // #################################################### @@ -601,6 +606,31 @@ async function addChild(device, els) { }); } +// #################################################### +// INIT AUDIO/VIDEO/SCREEN BUTTONS +// #################################################### + +function setupInitButtons() { + initVideoAudioRefreshButton.onclick = () => { + refreshMyAudioVideoDevices(); + }; + initVideoButton.onclick = () => { + handleVideo(); + }; + initAudioButton.onclick = () => { + handleAudio(); + }; + initAudioVideoButton.onclick = async () => { + await handleAudioVideo(e); + }; + initStartScreenButton.onclick = async () => { + await toggleScreenSharing(); + }; + initStopScreenButton.onclick = async () => { + await toggleScreenSharing(); + }; +} + // #################################################### // MICROPHONE VOLUME INDICATOR // #################################################### @@ -1349,6 +1379,19 @@ function stopRecordingTimer() { // #################################################### function handleButtons() { + // Lobby... + document.getElementById('lobbyUsers').addEventListener('click', function (event) { + switch (event.target.id) { + case 'lobbyAcceptAllBtn': + rc.lobbyAcceptAll(); + break; + case 'lobbyRejectAllBtn': + rc.lobbyRejectAll(); + break; + default: + break; + } + }); control.onmouseover = () => { isButtonsBarOver = true; }; diff --git a/public/views/Room.html b/public/views/Room.html index 2e86f806..e4959e15 100644 --- a/public/views/Room.html +++ b/public/views/Room.html @@ -118,7 +118,7 @@ - +
@@ -144,24 +144,12 @@ access to use this app. >
- - - - - - + + + + + + @@ -1408,16 +1396,8 @@ access to use this app.   All - - - - - - + +