I treated camera playback as “live with a start time.” Don’t.
Описание и применение
Веб‑приложение для мониторинга IP‑камер было доработано, чтобы воспроизведение записанного видео работало как VOD: корректный выбор сегментов, правильное отображение времени и безопасное управление доступом.
Задача
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.
Результат
Playback now behaves like VOD: correct first frame, accurate seek, proper empty state handling, and secure RBAC enforcement, eliminating the previous live‑stream misbehaviors.
Рабочий процесс
- 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
Доказательства
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.
- Дата записи: 2026-09-15T08:00:32.318Z