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);