diff --git a/www/webrtc/index.html b/www/webrtc/index.html
index 5fe5caee..a0879bea 100644
--- a/www/webrtc/index.html
+++ b/www/webrtc/index.html
@@ -3,17 +3,25 @@
ZLM RTC demo
+
-
-
@@ -27,7 +35,6 @@
-
@@ -88,7 +95,6 @@
-
-
-
-
11111
-
@@ -198,8 +200,17 @@
let elv = document.getElementById("videoDevice");
let ela = document.getElementById("audioDevice");
- let vdevid = JSON.parse(elv.options[elv.selectedIndex].value).deviceId
- let adevid = JSON.parse(ela.options[ela.selectedIndex].value).deviceId
+ let vdevid = ''
+ let adevid = ''
+
+ if (!recvOnly) {
+ if (elv.selectedIndex !== -1) {
+ vdevid = JSON.parse(elv.options[elv.selectedIndex].value).deviceId
+ }
+ if (ela.selectedIndex !== -1) {
+ adevid = JSON.parse(ela.options[ela.selectedIndex].value).deviceId
+ }
+ }
player = new ZLMRTCClient.Endpoint(
{