mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-14 17:44:40 -04:00
A detached Image() object does not reliably decode multipart MJPEG streams — browsers only update a DOM-attached <img> with each frame from a multipart/x-mixed-replace response. Switch to creating a hidden DOM <img> element and use requestAnimationFrame to copy decoded frames to the canvas. Also properly clean up the img element from the DOM in stop() and switchEvent(), and guard drawFrame() against drawing before the first frame has been decoded. Tested: start, pause, play, seek, setRate, stop all verified working against a live zms event stream. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>