fix(cctv): bound HLS sessions and isolate consumer playback leases

This commit is contained in:
Bilawal Sidhu committed 2026-09-15 10:52:30 -05:00
1 parent 48666cb9a4
commit 292cd610f3
22 files changed
+665 -730

No files matched your search

+7
View File
@@ -38,6 +38,11 @@ export class CctvControls {
this._calibrationEdit = null;
this._actionGeneration = 0;
this._initCctvPanel();
if (this._cctvVideo && typeof MutationObserver !== 'undefined') {
this._videoVisibilityObserver = new MutationObserver(() => this._renderCctvState(this._cctvState));
if (this._cctvPanel) this._videoVisibilityObserver.observe(this._cctvPanel, { attributes: true, attributeFilter: ['class', 'hidden'] });
this.listen(document, 'visibilitychange', () => this._renderCctvState(this._cctvState));
}
}
listen(target, type, handler, options = {}) {
target?.addEventListener(type, handler, {
@@ -99,6 +104,8 @@ export class CctvControls {
destroy() {
if (this.destroyed) return;
this.destroyed = true;
this._cctvVideoSurface?.stop();
this._videoVisibilityObserver?.disconnect();
this._actionGeneration++;
this.listeners.abort();
this._cctvUnsubscribe?.();