From fc6934ec2c81982f1c3433bf4b321ec5fc47d3e3 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Sun, 3 Oct 2021 20:31:10 +0200 Subject: [PATCH] [mirotalksfu] - add disable audio-video btn on join --- public/js/Room.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/public/js/Room.js b/public/js/Room.js index af7d226..ed869d2 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -37,6 +37,8 @@ let isAudioAllowed = false; let isVideoAllowed = false; let isAudioOn = true; let isVideoOn = true; +let initAudioButton = null; +let initVideoButton = null; let recTimer = null; let recElapsedTime = null; @@ -242,7 +244,8 @@ function whoAreYou() { html: `
- +  | +
`, confirmButtonText: `Join meeting`, showClass: { @@ -261,13 +264,14 @@ function whoAreYou() { joinRoom(peer_name, room_id); }); - let initAudioButton = document.getElementById('initAudioButton'); - let initVideoButton = document.getElementById('initVideoButton'); + initAudioButton = document.getElementById('initAudioButton'); + initVideoButton = document.getElementById('initVideoButton'); if (!isAudioAllowed) initAudioButton.className = 'hidden'; if (!isVideoAllowed) initVideoButton.className = 'hidden'; if (!DetectRTC.isMobileDevice) { setTippy('initAudioButton', 'Enable / Disable audio', 'left'); setTippy('initVideoButton', 'Enable / Disable video', 'right'); + setTippy('initDisableAllButton', 'Disable audio & video', 'right'); } } @@ -285,6 +289,14 @@ function handleVideo(e) { setColor(startVideoButton, isVideoOn ? 'white' : 'red'); } +function disableAudioVideo() { + isAudioOn, (isVideoOn = false); + initAudioButton.className = 'fas fa-microphone-slash'; + initVideoButton.className = 'fas fa-video-slash'; + setColor(initAudioButton, 'red'); + setColor(initVideoButton, 'red'); +} + // #################################################### // SHARE ROOM // ####################################################