mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-26 01:32:29 -04:00
When zms dies (any cause), the UI sets zmsBroke=true and subsequent seeks/plays silently fail. Instead, restart the stream by resetting the img src, which triggers the browser to make a new CGI request to zms with the same connkey, spawning a fresh process. Uses img.onload as the readiness signal rather than polling: when the new zms delivers its first MJPEG frame, onload fires, confirming the command socket is ready. This eliminates the race window where CMD_SEEK could be sent before the socket exists, and removes dependency on the poll interval (streamTimeout) for seek delivery. Implementation: - restartZmsStream(onReady): shared helper that clears img.src to kill the old connection, sets a one-shot onload handler, then sets the new src. onload clears zmsBroke and invokes the callback. - streamSeek(): when zmsBroke, calls restartZmsStream with a callback that re-invokes streamSeek(offset) once zms is alive. - playClicked(): when zmsBroke, calls restartZmsStream with no callback since zms starts in play mode by default. Consolidates duplicate restart logic that was previously inlined in both playClicked() and streamSeek(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Modern ZoneMinder Skin
This web frontend to ZoneMinder is a complete rewrite of the classic frontend, based on CakePHP.