fix: hide 'Waiting for first frame' placeholder once MJPEG delivers

No load handler existed — placeholder overlay (absolute inset:0) stayed
on top of the live stream forever. Hide on img load; toggle OFF already
re-shows it.
This commit is contained in:
jetson committed 2026-10-13 10:47:44 +07:00
1 parent d89c985134
commit 2efcdb2316
1 file changed
+9
+9
View File
@@ -450,6 +450,15 @@ function initStatusPage(jobId, initialStatus) {
var liveBoxUnloading = document.getElementById('live-box-unloading');
var liveBoxNet = document.getElementById('live-box-net');
// Hide the placeholder once the MJPEG stream delivers its first frame.
// The overlay sits on top of the img, so it must be removed, not just
// hidden behind it. Toggling OFF re-shows it via the change handler.
if (livePreviewImg) {
livePreviewImg.addEventListener('load', function () {
if (previewPlaceholder) previewPlaceholder.style.display = 'none';
});
}
if (previewToggle) {
previewToggle.addEventListener('change', function() {
if (this.checked) {