forked from andrew/feedmill-recounter
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:
1 parent
d89c985134
commit
2efcdb2316
1 file changed
+9
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user