@7365admin1/layer-common 4.17.1-staging.336 → 4.17.1-staging.337

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.
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div ref="root" class="vms">
2
+ <div ref="root" class="vms" :class="{ 'vms--full': isFullscreen }">
3
3
  <!-- ------------------------------------------------------------ toolbar -->
4
4
  <div class="vms__bar">
5
5
  <button
@@ -43,10 +43,10 @@
43
43
  <button
44
44
  type="button"
45
45
  class="vms__tool"
46
- title="Fill the screen with the wall"
46
+ :title="isFullscreen ? 'Leave full screen' : 'Fill the screen with the wall — the panel below is hidden while it is on'"
47
47
  @click="toggleFullscreen"
48
48
  >
49
- Full screen
49
+ {{ isFullscreen ? "Leave full screen" : "Full screen" }}
50
50
  </button>
51
51
  </div>
52
52
 
@@ -780,17 +780,38 @@ onMounted(() => {
780
780
  setOnline();
781
781
  window.addEventListener("online", setOnline);
782
782
  window.addEventListener("offline", setOnline);
783
+ document.addEventListener("fullscreenchange", onFullscreenChange);
784
+ // Safari fires its own event name.
785
+ document.addEventListener("webkitfullscreenchange", onFullscreenChange);
783
786
  });
784
787
 
785
788
  onBeforeUnmount(() => {
786
789
  window.removeEventListener("online", setOnline);
787
790
  window.removeEventListener("offline", setOnline);
791
+ document.removeEventListener("fullscreenchange", onFullscreenChange);
792
+ document.removeEventListener("webkitfullscreenchange", onFullscreenChange);
788
793
  });
789
794
 
790
795
  /* ------------------------------------------------------------- fullscreen */
791
796
 
792
797
  const root = ref<HTMLElement | null>(null);
793
798
 
799
+ /**
800
+ * In full screen the wall takes the whole screen.
801
+ *
802
+ * It did not: `.vms__body` is 68vh whatever the window is, so the picture kept
803
+ * two thirds of the screen and the capabilities panel below took the rest —
804
+ * the owner's "it squeezes the CCTV view". While full screen is on, the body
805
+ * takes the space that is left and the panel is not drawn; the toolbar and the
806
+ * pager stay, so the layout and the page can still be changed.
807
+ */
808
+ const isFullscreen = ref(false);
809
+
810
+ function onFullscreenChange() {
811
+ const el = document.fullscreenElement;
812
+ isFullscreen.value = Boolean(el && root.value && (el === root.value || root.value.contains(el)));
813
+ }
814
+
794
815
  async function toggleFullscreen() {
795
816
  const el = root.value;
796
817
  if (!el) return;
@@ -913,6 +934,22 @@ async function toggleFullscreen() {
913
934
  height: 68vh;
914
935
  }
915
936
 
937
+ /* Full screen: the wall gets the screen, the capabilities panel stands down. */
938
+ .vms--full {
939
+ display: flex;
940
+ flex-direction: column;
941
+ height: 100vh;
942
+ }
943
+
944
+ .vms--full .vms__body {
945
+ flex: 1 1 auto;
946
+ height: auto;
947
+ }
948
+
949
+ .vms--full .vms__caps {
950
+ display: none;
951
+ }
952
+
916
953
  .vms__picker {
917
954
  width: 220px;
918
955
  flex: none;
@@ -157,6 +157,7 @@ import {
157
157
  liveSource,
158
158
  LIVE_CONNECT_TIMEOUT_MS,
159
159
  LIVE_FRAME_TIMEOUT_MS,
160
+ stateAfterFrameSilence,
160
161
  playerOrigin,
161
162
  playerSignal,
162
163
  tileView,
@@ -218,6 +219,8 @@ const frameEl = ref<HTMLIFrameElement | null>(null);
218
219
  const player = ref<TPlayerState>("loading");
219
220
  let timer: ReturnType<typeof setTimeout> | null = null;
220
221
  let frameTimer: ReturnType<typeof setTimeout> | null = null;
222
+ /** How many frame reports this address has produced — see `stateAfterFrameSilence`. */
223
+ let frameReports = 0;
221
224
 
222
225
  const view = computed(() =>
223
226
  tileView(props.camera, { online: props.online, player: player.value })
@@ -407,6 +410,7 @@ function onPlayerMessage(event: MessageEvent) {
407
410
 
408
411
  clearTimer();
409
412
  if (signal === "playing") {
413
+ frameReports += 1;
410
414
  player.value = "playing";
411
415
  // A picture that arrived once and stopped must not stay green. This is the
412
416
  // mobile app's "Live over a nine-second-old still" defect, and the clock is
@@ -435,7 +439,7 @@ function clearFrameTimer() {
435
439
  function restartFrameClock() {
436
440
  clearFrameTimer();
437
441
  frameTimer = setTimeout(() => {
438
- if (player.value === "playing") player.value = "stalled";
442
+ if (player.value === "playing") player.value = stateAfterFrameSilence(frameReports);
439
443
  }, LIVE_FRAME_TIMEOUT_MS);
440
444
  }
441
445
 
@@ -454,6 +458,7 @@ watch(
454
458
  (host) => {
455
459
  clearTimer();
456
460
  clearFrameTimer();
461
+ frameReports = 0;
457
462
  player.value = "loading";
458
463
  if (!host) return;
459
464
  timer = setTimeout(() => {
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.17.1-staging.336",
5
+ "version": "4.17.1-staging.337",
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.",
@@ -613,6 +613,26 @@ export const LIVE_CONNECT_TIMEOUT_MS = 15_000;
613
613
  */
614
614
  export const LIVE_FRAME_TIMEOUT_MS = 12_000;
615
615
 
616
+ /**
617
+ * What silence after a frame report MEANS — and it depends on how many reports
618
+ * there have ever been.
619
+ *
620
+ * The relay reports the FIRST decoded frame and nothing after it (measured
621
+ * 2026-09-21 against the live relay: one `{event:"frame",state:"live"}` in 25
622
+ * seconds while the websocket carried 410 video frames). Treating that silence
623
+ * as a stall put "The picture stopped arriving" over four tiles that were
624
+ * playing perfectly — the same lie as a green badge over a frozen picture,
625
+ * pointed the other way.
626
+ *
627
+ * So: two or more reports mean the service does report frames, and silence
628
+ * after that is a real stall. A single report proves the picture STARTED and
629
+ * proves nothing about now, which is "Not confirmed" — the tile keeps showing
630
+ * the stream and says plainly that it cannot vouch for it.
631
+ */
632
+ export function stateAfterFrameSilence(frameReports: number): "stalled" | "page-up" {
633
+ return frameReports >= 2 ? "stalled" : "page-up";
634
+ }
635
+
616
636
  export type TTileState =
617
637
  | "live"
618
638
  | "unverified"