From 5919113e286642d1883daf0af2f32a4b8429465c Mon Sep 17 00:00:00 2001 From: USAMAWIZARD Date: Fri, 24 Nov 2023 16:47:21 +0530 Subject: [PATCH 1/4] add camera mic toggle add open in new tab button --- src/main/webapp/multitrack-conference.html | 97 ++++++++++++---------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/src/main/webapp/multitrack-conference.html b/src/main/webapp/multitrack-conference.html index 347fe5dd..3589e1c9 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,10 @@

WebRTC Conference

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

WebRTC Conference

} } - function turnOffLocalCamera() { - webRTCAdaptor.turnOffLocalCamera(); - isCameraOff = true; - handleCameraButtons(); - sendNotificationEvent("CAM_TURNED_OFF"); + function openInNewTab(){ + let parrentURL= getUrlParameter("parrentURL") + if(parrentURL==null) + parrentURL="" + window.open(parrentURL+"?roomname="+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 +391,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" } } From d6bf3a224a288e711c6bfc79d46b5a53dffcccd3 Mon Sep 17 00:00:00 2001 From: USAMAWIZARD Date: Fri, 24 Nov 2023 17:21:39 +0530 Subject: [PATCH 2/4] add camera mic toggle add open in new tab button --- redeploy.sh | 2 +- src/main/webapp/images/camoff.png | Bin 0 -> 579 bytes src/main/webapp/images/camon.png | Bin 0 -> 374 bytes src/main/webapp/images/mute.png | Bin 0 -> 1184 bytes src/main/webapp/images/unmute.png | Bin 0 -> 1067 bytes src/main/webapp/multitrack-conference.html | 7 ++----- 6 files changed, 3 insertions(+), 6 deletions(-) create mode 100644 src/main/webapp/images/camoff.png create mode 100644 src/main/webapp/images/camon.png create mode 100644 src/main/webapp/images/mute.png create mode 100644 src/main/webapp/images/unmute.png diff --git a/redeploy.sh b/redeploy.sh index ac98e87f..0a1cd419 100755 --- a/redeploy.sh +++ b/redeploy.sh @@ -1,5 +1,5 @@ #!/bin/sh -AMS_DIR=~/softwares/ant-media-server +AMS_DIR=/usr/local/antmedia mvn clean install -DskipTests -Dgpg.skip=true OUT=$? diff --git a/src/main/webapp/images/camoff.png b/src/main/webapp/images/camoff.png new file mode 100644 index 0000000000000000000000000000000000000000..228c00df5ddfec6374744be6e75bde67f7936c0b GIT binary patch literal 579 zcmV-J0=)f+P)= z58xGqVEaxMf`SSzL_}1CqNflmxDhJ@q12MtB$G*|k_To}n7;Y-P4h8>f_s4{A1aJ; z6g(>EDrk>1#)C-(&l)4}(u65SHC~BvG+x;mN8^>9aUeb{DmYirQLrC;R?+vD;67tz z2z&@!`LJw^5ZDbVu$LF6ZycI-BI?&_6o9Fwf&{12Ute6$8FQKB`0rp`phobY7^elg-d0@DIV z3ce!eq$#8?*ETT(IfV&<1A)(>bJ7+Q*tB&uBZ$CT>^UX{1$Jz7h9HUNm=?8xp$Lc# z3`IeLv7Hr$f+3kMrW%xc(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001 diff --git a/src/main/webapp/multitrack-conference.html b/src/main/webapp/multitrack-conference.html index 3589e1c9..fee88b29 100644 --- a/src/main/webapp/multitrack-conference.html +++ b/src/main/webapp/multitrack-conference.html @@ -283,9 +283,6 @@

WebRTC Conference

var roomNameBox = document.getElementById("roomName"); if (roomId != null) { - var roomname = getUrlParameter("roomname"); - if(roomname != "undefined" && roomname != undefined) - roomNameBox.value=roomname; roomNameBox.value = roomId; } @@ -313,9 +310,9 @@

WebRTC Conference

function openInNewTab(){ let parrentURL= getUrlParameter("parrentURL") - if(parrentURL==null) + if(parrentURL==null || parrentURL==undefined) parrentURL="" - window.open(parrentURL+"?roomname="+roomNameBox.value ); + window.open(parrentURL+"?roomname="+roomNameBox.value); } function toggleLocalCamera() { From 1b9b3c06683bbaf14fcb165549fa1c94d0354ed2 Mon Sep 17 00:00:00 2001 From: USAMAWIZARD Date: Fri, 24 Nov 2023 17:25:41 +0530 Subject: [PATCH 3/4] add camera mic toggle add open in new tab button --- src/main/webapp/multitrack-conference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/multitrack-conference.html b/src/main/webapp/multitrack-conference.html index fee88b29..f187bb02 100644 --- a/src/main/webapp/multitrack-conference.html +++ b/src/main/webapp/multitrack-conference.html @@ -312,7 +312,7 @@

WebRTC Conference

let parrentURL= getUrlParameter("parrentURL") if(parrentURL==null || parrentURL==undefined) parrentURL="" - window.open(parrentURL+"?roomname="+roomNameBox.value); + window.open(parrentURL+"?roomId="+roomNameBox.value); } function toggleLocalCamera() { From 78b170e86ed45cef5ad4ee817da706008c71d9e8 Mon Sep 17 00:00:00 2001 From: USAMA Date: Sat, 9 Dec 2023 15:48:40 +0530 Subject: [PATCH 4/4] Update redeploy.sh --- redeploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redeploy.sh b/redeploy.sh index 0a1cd419..ac98e87f 100755 --- a/redeploy.sh +++ b/redeploy.sh @@ -1,5 +1,5 @@ #!/bin/sh -AMS_DIR=/usr/local/antmedia +AMS_DIR=~/softwares/ant-media-server mvn clean install -DskipTests -Dgpg.skip=true OUT=$?