diff --git a/src/main/webapp/images/camoff.png b/src/main/webapp/images/camoff.png new file mode 100644 index 00000000..228c00df Binary files /dev/null and b/src/main/webapp/images/camoff.png differ diff --git a/src/main/webapp/images/camon.png b/src/main/webapp/images/camon.png new file mode 100644 index 00000000..76821fa0 Binary files /dev/null and b/src/main/webapp/images/camon.png differ diff --git a/src/main/webapp/images/mute.png b/src/main/webapp/images/mute.png new file mode 100644 index 00000000..f9743bbf Binary files /dev/null and b/src/main/webapp/images/mute.png differ diff --git a/src/main/webapp/images/unmute.png b/src/main/webapp/images/unmute.png new file mode 100644 index 00000000..0b932bd0 Binary files /dev/null and b/src/main/webapp/images/unmute.png differ diff --git a/src/main/webapp/multitrack-conference.html b/src/main/webapp/multitrack-conference.html index f89103c3..8fa5d181 100644 --- a/src/main/webapp/multitrack-conference.html +++ b/src/main/webapp/multitrack-conference.html @@ -133,14 +133,13 @@

WebRTC Conference

id="join_publish_button">Join Room +
- - - - - + Turn off Camera + Unmute Local Mic
@@ -258,14 +257,12 @@

WebRTC Conference

join_publish_button.addEventListener("click", joinRoom, false); var stop_publish_button = document.getElementById("stop_publish_button"); stop_publish_button.addEventListener("click", leaveRoom, false); - var turn_off_camera_button = document.getElementById("turn_off_camera_button"); - turn_off_camera_button.addEventListener("click", turnOffLocalCamera,false) - var turn_on_camera_button = document.getElementById("turn_on_camera_button"); - turn_on_camera_button.addEventListener("click", turnOnLocalCamera,false) - var mute_mic_button = document.getElementById("mute_mic_button"); - mute_mic_button.addEventListener("click", muteLocalMic,false) - var unmute_mic_button = document.getElementById("unmute_mic_button"); - unmute_mic_button.addEventListener("click", unmuteLocalMic,false) + var toggle_camera_button = document.getElementById("toggle_camera_button"); + toggle_camera_button.addEventListener("click", toggleLocalCamera,false) + var toggle_mic_button = document.getElementById("toggle_mic_button"); + toggle_mic_button.addEventListener("click", toggleLocalMic,false) + var open_in_new_tab = document.getElementById("open_in_new_tab"); + open_in_new_tab.addEventListener("click",openInNewTab,false); var options = document.getElementById("options"); options.addEventListener("click", toggleOptions, false); var send = document.getElementById("send"); @@ -286,7 +283,7 @@

WebRTC Conference

var roomNameBox = document.getElementById("roomName"); if (roomId != null) { - roomNameBox.value = roomId; + roomNameBox.value = roomId; } var isDataChannelOpen = false; @@ -311,32 +308,43 @@

WebRTC Conference

} } - function turnOffLocalCamera() { - webRTCAdaptor.turnOffLocalCamera(); - isCameraOff = true; - handleCameraButtons(); - sendNotificationEvent("CAM_TURNED_OFF"); + function openInNewTab(){ + let parrentURL= getUrlParameter("parrentURL") + if(parrentURL==null || parrentURL==undefined) + parrentURL="" + window.open(parrentURL+"?roomId="+roomNameBox.value); } - function turnOnLocalCamera() { - webRTCAdaptor.turnOnLocalCamera(); - isCameraOff = false; - handleCameraButtons(); - sendNotificationEvent("CAM_TURNED_ON"); - } + function toggleLocalCamera() { + if (isCameraOff) { + webRTCAdaptor.turnOnLocalCamera(); + isCameraOff = false; + handleCameraButtons(); + sendNotificationEvent("CAM_TURNED_ON"); + + } + else { + webRTCAdaptor.turnOffLocalCamera(); + isCameraOff = true; + handleCameraButtons(); + sendNotificationEvent("CAM_TURNED_OFF"); - function muteLocalMic(){ - webRTCAdaptor.muteLocalMic(); - isMicMuted = true; - handleMicButtons(); - sendNotificationEvent("MIC_MUTED"); + } } - function unmuteLocalMic() { - webRTCAdaptor.unmuteLocalMic(); - isMicMuted = false; - handleMicButtons(); - sendNotificationEvent("MIC_UNMUTED"); + function toggleLocalMic() { + if (isMicMuted) { + webRTCAdaptor.unmuteLocalMic(); + isMicMuted = false; + handleMicButtons(); + sendNotificationEvent("MIC_UNMUTED"); + } + else { + webRTCAdaptor.muteLocalMic(); + isMicMuted = true; + handleMicButtons(); + sendNotificationEvent("MIC_MUTED"); + } } function sendNotificationEvent(eventType) { @@ -380,22 +388,18 @@

WebRTC Conference

} function handleCameraButtons() { - if(isCameraOff) { - turn_off_camera_button.disabled = true; - turn_on_camera_button.disabled = false; + if (isCameraOff) { + toggle_camera_button.src = "./images/camoff.png"; } else { - turn_off_camera_button.disabled = false; - turn_on_camera_button.disabled = true; + toggle_camera_button.src = "./images/camon.png"; } } function handleMicButtons() { - if(isMicMuted) { - mute_mic_button.disabled = true; - unmute_mic_button.disabled = false; + if (isMicMuted) { + toggle_mic_button.src = "./images/mute.png" } else { - mute_mic_button.disabled = false; - unmute_mic_button.disabled = true; + toggle_mic_button.src = "./images/unmute.png" } }