fix(www/webrtc): update 1080x720~1280x720 as default selected resolution in webrtc. (#2645)

This commit is contained in:
johzzy 2023-07-09 13:04:05 +08:00 committed by GitHub
parent d41afa5d48
commit 15d752d6ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,14 +124,14 @@
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);