@7365admin1/layer-common 4.97.1-staging.636 → 4.97.1-staging.637

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@
12
12
  'Optional: type the objects that matter (e.g. person, car, rubbish) so not everything alerts. Empty means every object.',
13
13
  'Optional: limit to zones or cameras, and set quiet hours. Then press Save alert settings.',
14
14
  ]"
15
- results="Alerts appear in Events marked Alert, and as a notification with the picture on the phones of the roles you chose."
15
+ results="Alerts appear in Events marked Alert. With Send phone notifications on, people also get a notification with the picture."
16
16
  results-section="events"
17
17
  :results-query="{ severity: 'alert' }"
18
18
  />
@@ -4,9 +4,14 @@
4
4
  Offline engine / failures are shown on the tile in plain words with a Try again button.
5
5
  -->
6
6
  <template>
7
- <div class="cctv-tile" :class="{ 'cctv-tile--big': big, 'cctv-tile--natural': natural }" data-test="cctv-tile">
8
- <video v-show="mode === 'live'" ref="video" autoplay muted playsinline class="cctv-tile__media" />
9
- <img v-if="mode === 'still' && still" :src="still" :alt="`Latest picture from ${camera}`" class="cctv-tile__media" />
7
+ <div
8
+ class="cctv-tile"
9
+ :class="{ 'cctv-tile--big': big, 'cctv-tile--natural': natural }"
10
+ :style="shape && !natural ? { aspectRatio: shape } : undefined"
11
+ data-test="cctv-tile"
12
+ >
13
+ <video v-show="mode === 'live'" ref="video" autoplay muted playsinline class="cctv-tile__media" @loadedmetadata="fit($event)" @resize="fit($event)" />
14
+ <img v-if="mode === 'still' && still" :src="still" :alt="`Latest picture from ${camera}`" class="cctv-tile__media" @load="fit($event)" />
10
15
 
11
16
  <div v-if="mode === 'connecting'" class="cctv-tile__msg" role="status">
12
17
  <v-progress-circular indeterminate size="22" /> <span>Connecting to {{ camera }}...</span>
@@ -47,6 +52,15 @@ const still = ref("");
47
52
  const failure = ref<unknown>(null);
48
53
  const video = ref<HTMLVideoElement | null>(null);
49
54
  const notice = computed(() => cctvNotice(failure.value));
55
+ // The box takes the camera's own shape once the first picture arrives (many recorders send 4:3 or 704x480),
56
+ // so the picture fills it instead of sitting between black bars; 16:9 until then.
57
+ const shape = ref<string | null>(null);
58
+ function fit(e: Event) {
59
+ const el = e.target as HTMLVideoElement & HTMLImageElement;
60
+ const w = el.videoWidth || el.naturalWidth;
61
+ const h = el.videoHeight || el.naturalHeight;
62
+ if (w > 0 && h > 0) shape.value = `${w} / ${h}`;
63
+ }
50
64
 
51
65
  let pc: RTCPeerConnection | null = null;
52
66
  let timer: ReturnType<typeof setTimeout> | null = null;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.97.1-staging.636",
5
+ "version": "4.97.1-staging.637",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",