I treated camera playback as “live with a start time.” Don’t.
Description and use
A web app for IP‑camera monitoring was improved so that recorded playback behaves like VOD: correct segment selection, accurate time display, and secure access control.
Problem
Treating recorded IP camera playback as a live stream with a start time caused incorrect GOP selection, misleading seek bars, and timezone mismatches, leading to poor user experience and security issues.
Outcome
Playback now behaves like VOD: correct first frame, accurate seek, proper empty state handling, and secure RBAC enforcement, eliminating the previous live‑stream misbehaviors.
Workflow
- Select a time range using a site‑time picker
- Send authorized request to list available segments for the range
- If segments exist, initialize a playback player with the segment list
- On mode switch, destroy any existing player before creating a new one
- Handle empty ranges by showing a clear message
- Ensure RBAC controls hide playback for users without review permission
- Log channelId and timestamps for debugging
- Use separate live tiles for live‑device actions like PTZ or two‑way talk
Evidence
If the list‑segments call returns [], I stop. I do not init the player “just in case.”
The bug that bit me: pause() on live and then seek(). Some stacks ignore seek on a live transport.
- Record date: 2026-09-15T08:00:32.318Z