mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 11:42:21 +00:00
Merge branch 'main' into byrdit/cctv-visible-only-fetch
This commit is contained in:
18 files changed
+1209
-300
No files matched your search
@@ -186,6 +186,14 @@ export function _settleCctvFrame(token, src, ok) {
|
||||
);
|
||||
}
|
||||
|
||||
/** Shared live health describes the stream even when this viewer shows a frame. */
|
||||
export function isCctvLiveFrameFallback(activeCamera) {
|
||||
return (
|
||||
activeCamera?.isVideo === false &&
|
||||
String(activeCamera.sourceKind || '').toLowerCase() === 'live'
|
||||
);
|
||||
}
|
||||
|
||||
/** The source badge's label and frame state for the camera and preview. */
|
||||
export function presentCctvSourceBadge(activeCamera, enabled, frame) {
|
||||
if (!enabled || !activeCamera)
|
||||
@@ -194,6 +202,11 @@ export function presentCctvSourceBadge(activeCamera, enabled, frame) {
|
||||
return { label: t('FRAME · LOADING'), state: 'loading' };
|
||||
if (frame.error && !frame.hasFrame)
|
||||
return { label: t('FRAME · UNAVAILABLE'), state: 'error' };
|
||||
if (isCctvLiveFrameFallback(activeCamera))
|
||||
return {
|
||||
label: `${cctvSourceKindLabel('fallback')} · ${cctvSourceStatusLabel('degraded')}`,
|
||||
state: 'ready',
|
||||
};
|
||||
const kind = cctvSourceKindLabel(
|
||||
activeCamera.sourceKind || activeCamera.feedType || 'unknown',
|
||||
);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { getLocale, keepCodesWithValues, msg, t, tn } from '../i18n/index.js';
|
||||
import { cctvSourceLabelText, cctvSourceMessageText } from './cctvFrames.js';
|
||||
import {
|
||||
cctvSourceLabelText,
|
||||
cctvSourceMessageText,
|
||||
isCctvLiveFrameFallback,
|
||||
} from './cctvFrames.js';
|
||||
|
||||
import { createCctvVideoSurface } from './cctvVideo.js';
|
||||
import { presentCctvCalibration } from './cctvCalibration.js';
|
||||
@@ -105,9 +109,10 @@ function metaText(state, enabled, activeCamera, catalogCount) {
|
||||
const provider = cctvSourceLabelText(
|
||||
activeCamera.sourceLabel || activeCamera.provider || 'Configured Source',
|
||||
);
|
||||
const statusMsg = activeCamera.sourceMessage
|
||||
? ` · ${cctvSourceMessageText(activeCamera.sourceMessage)}`
|
||||
: '';
|
||||
const statusMsg =
|
||||
activeCamera.sourceMessage && !isCctvLiveFrameFallback(activeCamera)
|
||||
? ` · ${cctvSourceMessageText(activeCamera.sourceMessage)}`
|
||||
: '';
|
||||
// A partner-supplied feed inside a pack names its owner here.
|
||||
const credit = activeCamera.credit ? ` · ${activeCamera.credit}` : '';
|
||||
const calBadge = activeCamera.calBadge
|
||||
|
||||
Reference in new issue
Block a user