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 // ####################################################