Add top-1000 checkbox to ONVIF page, classify JPEG streams as alternative

- Add checked-by-default checkbox to also test popular stream patterns
- Move JPEG-only streams (no H264/H265) to Alternative group in test results
This commit is contained in:
eduard256
2026-04-08 11:27:08 +00:00
parent 0fb7356a5e
commit e47c0f7ce6
2 changed files with 51 additions and 0 deletions
+49
View File
@@ -217,6 +217,41 @@
}
.btn-outline:hover { border-color: var(--purple-primary); color: var(--purple-light); }
/* Checkbox */
.checkbox-row {
margin-bottom: 1.5rem;
}
.checkbox-label {
display: flex; align-items: center; gap: 0.625rem;
font-size: 0.875rem; color: var(--text-secondary);
cursor: pointer; user-select: none;
}
.checkbox-label input { display: none; }
.checkbox-custom {
width: 18px; height: 18px; flex-shrink: 0;
border: 2px solid var(--border-color);
border-radius: 4px;
background: var(--bg-secondary);
transition: all var(--transition-fast);
position: relative;
}
.checkbox-label input:checked + .checkbox-custom {
background: var(--purple-primary);
border-color: var(--purple-primary);
}
.checkbox-label input:checked + .checkbox-custom::after {
content: '';
position: absolute; top: 2px; left: 5px;
width: 5px; height: 9px;
border: solid white; border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
</style>
</head>
@@ -281,6 +316,14 @@
</div>
</div>
<div class="checkbox-row" id="checkbox-row">
<label class="checkbox-label">
<input type="checkbox" id="cb-top1000" checked>
<span class="checkbox-custom"></span>
Also test popular stream patterns
</label>
</div>
<button class="btn btn-primary btn-large" id="btn-discover">Discover Streams</button>
<button class="btn-outline" id="btn-standard">Skip, use Standard Discovery</button>
<button class="btn-outline" id="btn-homekit" style="display:none">Try HomeKit Pairing</button>
@@ -372,6 +415,12 @@
if (hostname) p.set('hostname', hostname);
if (ports) p.set('ports', ports);
if (document.getElementById('cb-top1000').checked) {
p.set('ids', 'p:top-1000');
p.set('user', user);
if (pass) p.set('pass', pass);
}
window.location.href = 'create.html?' + p.toString();
});
+2
View File
@@ -424,8 +424,10 @@
function classifyResult(r) {
var scheme = r.source.split('://')[0] || '';
var isRecommended = scheme === 'rtsp' || scheme === 'rtsps' || scheme === 'onvif';
var isJpegOnly = r.codecs && r.codecs.length > 0 && r.codecs.indexOf('H264') === -1 && r.codecs.indexOf('H265') === -1;
var isHD = r.width >= 1280;
if (isJpegOnly) return 'alt';
if (isRecommended && isHD) return 'rec-main';
if (isRecommended) return 'rec-sub';
return 'alt';