From 15d752d6ae81b05315d35faa8616ba8a608cfe36 Mon Sep 17 00:00:00 2001 From: johzzy Date: Sun, 9 Jul 2023 13:04:05 +0800 Subject: [PATCH] fix(www/webrtc): update 1080x720~1280x720 as default selected resolution in webrtc. (#2645) --- www/webrtc/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/www/webrtc/index.html b/www/webrtc/index.html index 78fb905b..555fc5b5 100644 --- a/www/webrtc/index.html +++ b/www/webrtc/index.html @@ -122,16 +122,16 @@ }; }); - ZLMRTCClient.GetAllScanResolution().forEach((r,i)=>{ + ZLMRTCClient.GetAllScanResolution().forEach((r,i) => { opt = document.createElement('option'); - opt.text = r.label +"("+r.width+"x"+r.height+")"; + opt.text = `${r.label}(${r.width}x${r.height})`; opt.value = r; + if (1080*720 <= r.width * r.height && r.width * r.height <= 1280*720) { + opt.selected = true; + } document.getElementById("resolution").add(opt,null) + }); - //console.log(opt.text.match(/\d+/g)) - - - }) function start_play(){ let elr = document.getElementById("resolution"); let res = elr.options[elr.selectedIndex].text.match(/\d+/g);