diff --git a/www/webrtc/index.html b/www/webrtc/index.html index 9a1764f1..a72bac29 100644 --- a/www/webrtc/index.html +++ b/www/webrtc/index.html @@ -46,7 +46,8 @@
- + + echo push play
@@ -84,17 +85,15 @@ document.getElementById('streamUrl').value = url document.getElementsByName("methond").forEach((el,idx)=>{ el.onclick=function(e){ - if(el.value == "play") - { - let url = document.getElementById('streamUrl').value; - - document.getElementById('streamUrl').value = url.replace("&type=push","&type=play"); + let url = new URL(document.getElementById('streamUrl').value); + url.searchParams.set("type",el.value) + document.getElementById('streamUrl').value = url.toString() + + if(el.value == "play"){ recvOnly = true; - } - else - { - let url = document.getElementById('streamUrl').value; - document.getElementById('streamUrl').value = url.replace("&type=play","&type=push"); + }else if(el.value == "echo"){ + recvOnly = false; + }else{ recvOnly = false; } };