feat(fleet): add board observation center with live sources and maps
Add adaptive per-vehicle layouts, full-panel dragging, source controls and automatic preview recovery for RealSense, Insta360 X4 and XGRIDS K1 observation views. Integrate cached Cesium map layers through the private NAS gateway link, retain bounded sensor command receipts, and document validation and operational handoff.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
type PreviewVideo = Pick<HTMLVideoElement, 'paused' | 'srcObject' | 'muted' | 'play'>;
|
||||
|
||||
/** Restore browser presentation without changing the peer or camera capture. */
|
||||
export function previewPlayback(video: PreviewVideo | null) {
|
||||
let disposed = false, pending = false;
|
||||
return {
|
||||
resume() {
|
||||
if (disposed || pending || !video?.srcObject || !video.paused) return;
|
||||
pending = true;
|
||||
video.muted = true;
|
||||
// WebKit can pause an offscreen panel and reject playback while it remains hidden.
|
||||
// A later visibility/presentation check retries playback on the same stream.
|
||||
void video.play().catch(() => undefined).finally(() => { pending = false; });
|
||||
},
|
||||
dispose() { disposed = true; },
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user