@camstack/ui-library 1.2.183 → 1.2.185

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
  import { ReactNode } from 'react';
2
- import { CamProfile, StationaryOverlayBox } from '@camstack/types';
2
+ import { CamProfile, WebrtcSessionDebug, StationaryOverlayBox } from '@camstack/types';
3
3
  import { SignalingResult, ClientOfferResult, ClientStreamHints, SessionSignalingState } from './camera-stream-player';
4
4
  import { DeviceDetections } from '../hooks/use-device-detections';
5
5
  /**
@@ -69,6 +69,12 @@ export interface StreamPanelProps {
69
69
  * adaptive re-offer (steady-state behaviour is unchanged).
70
70
  */
71
71
  readonly getSessionState?: (sessionId: string) => Promise<SessionSignalingState>;
72
+ /**
73
+ * The server half of the stream-debug overlay. Optional, and when it is
74
+ * absent the overlay SAYS so rather than showing an empty section — a panel
75
+ * that silently omits half its answer is worse than one that admits it.
76
+ */
77
+ readonly getSessionDebug?: (sessionId: string) => Promise<WebrtcSessionDebug>;
72
78
  /**
73
79
  * When set, the panel switches to VOD mode: it renders an `HlsVideo`
74
80
  * over this master `.m3u8` URL INSTEAD of the live WebRTC player, and
@@ -196,4 +202,4 @@ export interface StreamPanelProps {
196
202
  readonly chromeless?: boolean;
197
203
  readonly className?: string;
198
204
  }
199
- export declare function StreamPanel({ serverUrl, createSession, sendAnswer, handleOffer, getIceServers, addIceCandidate, getIceCandidates, closeSession, getSessionState, playbackUrl, playbackAuthToken, onExitPlayback, posterUrl, streams, activeStreamId: controlledStreamId, onStreamChange, deviceName, phase, pipelineMetrics, detections, stationaryObjects, defaultShowDetections, defaultShowMotion, streamStats, autoPlay, showPlayStop, snapshotSrc, snapshotLoading, onRefreshSnapshot, showStreamStats, children, extraOverlay, ptzAvailable, ptzShown, ptzOverlay, onPtzToggle, intercomAvailable, intercomShown, onIntercomToggle, chromeless, className, }: StreamPanelProps): import("react").JSX.Element;
205
+ export declare function StreamPanel({ serverUrl, createSession, sendAnswer, handleOffer, getIceServers, addIceCandidate, getIceCandidates, closeSession, getSessionState, getSessionDebug, playbackUrl, playbackAuthToken, onExitPlayback, posterUrl, streams, activeStreamId: controlledStreamId, onStreamChange, deviceName, phase, pipelineMetrics, detections, stationaryObjects, defaultShowDetections, defaultShowMotion, streamStats, autoPlay, showPlayStop, snapshotSrc, snapshotLoading, onRefreshSnapshot, showStreamStats, children, extraOverlay, ptzAvailable, ptzShown, ptzOverlay, onPtzToggle, intercomAvailable, intercomShown, onIntercomToggle, chromeless, className, }: StreamPanelProps): import("react").JSX.Element;
package/dist/index.cjs CHANGED
@@ -27444,9 +27444,16 @@ function StreamDebugOverlay(props) {
27444
27444
  measuredAt: server?.observedAt ?? null,
27445
27445
  now
27446
27446
  }),
27447
- !serverWired ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
27448
- className: "text-white/50 leading-tight py-0.5",
27449
- children: "not wired on this host"
27447
+ !serverWired ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
27448
+ className: "text-amber-300/90 leading-tight py-0.5",
27449
+ children: [
27450
+ "not wired on this surface — this player was mounted without",
27451
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
27452
+ className: "text-white/80",
27453
+ children: " getSessionDebug"
27454
+ }),
27455
+ ", so the server half cannot be asked"
27456
+ ]
27450
27457
  }) : serverError !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
27451
27458
  className: "text-rose-300 leading-tight py-0.5 break-words",
27452
27459
  children: serverError
@@ -28608,7 +28615,10 @@ function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, mute
28608
28615
  let cancelled = false;
28609
28616
  const tick = async () => {
28610
28617
  const sid = activeSessionIdRef.current;
28611
- if (sid === null) return;
28618
+ if (sid === null) {
28619
+ setServerDebugError("no session id on this player yet — nothing to ask the server about");
28620
+ return;
28621
+ }
28612
28622
  try {
28613
28623
  const answer = await getSessionDebug(sid);
28614
28624
  if (cancelled) return;
@@ -51072,7 +51082,7 @@ function ImageOffIcon({ className }) {
51072
51082
  ]
51073
51083
  });
51074
51084
  }
51075
- function StreamPanel({ serverUrl, createSession, sendAnswer, handleOffer, getIceServers, addIceCandidate, getIceCandidates, closeSession, getSessionState, playbackUrl, playbackAuthToken, onExitPlayback, posterUrl, streams, activeStreamId: controlledStreamId, onStreamChange, deviceName, phase, pipelineMetrics, detections, stationaryObjects, defaultShowDetections = true, defaultShowMotion = false, streamStats, autoPlay = false, showPlayStop = false, snapshotSrc, snapshotLoading = false, onRefreshSnapshot, showStreamStats = false, children, extraOverlay, ptzAvailable = false, ptzShown = false, ptzOverlay, onPtzToggle, intercomAvailable = false, intercomShown = false, onIntercomToggle, chromeless = false, className }) {
51085
+ function StreamPanel({ serverUrl, createSession, sendAnswer, handleOffer, getIceServers, addIceCandidate, getIceCandidates, closeSession, getSessionState, getSessionDebug, playbackUrl, playbackAuthToken, onExitPlayback, posterUrl, streams, activeStreamId: controlledStreamId, onStreamChange, deviceName, phase, pipelineMetrics, detections, stationaryObjects, defaultShowDetections = true, defaultShowMotion = false, streamStats, autoPlay = false, showPlayStop = false, snapshotSrc, snapshotLoading = false, onRefreshSnapshot, showStreamStats = false, children, extraOverlay, ptzAvailable = false, ptzShown = false, ptzOverlay, onPtzToggle, intercomAvailable = false, intercomShown = false, onIntercomToggle, chromeless = false, className }) {
51076
51086
  const registeredButtons = usePlayerToolbarButtons();
51077
51087
  const recordedPlayback = useRecordedPlayback();
51078
51088
  const [isPlaying, setIsPlaying] = (0, react$1.useState)(autoPlay);
@@ -51390,6 +51400,7 @@ function StreamPanel({ serverUrl, createSession, sendAnswer, handleOffer, getIce
51390
51400
  handleOffer: playerHandleOffer,
51391
51401
  reoffer: playerReoffer,
51392
51402
  getSessionState,
51403
+ ...getSessionDebug ? { getSessionDebug } : {},
51393
51404
  getIceServers,
51394
51405
  addIceCandidate,
51395
51406
  getIceCandidates,
package/dist/index.js CHANGED
@@ -27420,9 +27420,16 @@ function StreamDebugOverlay(props) {
27420
27420
  measuredAt: server?.observedAt ?? null,
27421
27421
  now
27422
27422
  }),
27423
- !serverWired ? /* @__PURE__ */ jsx("div", {
27424
- className: "text-white/50 leading-tight py-0.5",
27425
- children: "not wired on this host"
27423
+ !serverWired ? /* @__PURE__ */ jsxs("div", {
27424
+ className: "text-amber-300/90 leading-tight py-0.5",
27425
+ children: [
27426
+ "not wired on this surface — this player was mounted without",
27427
+ /* @__PURE__ */ jsx("span", {
27428
+ className: "text-white/80",
27429
+ children: " getSessionDebug"
27430
+ }),
27431
+ ", so the server half cannot be asked"
27432
+ ]
27426
27433
  }) : serverError !== null ? /* @__PURE__ */ jsx("div", {
27427
27434
  className: "text-rose-300 leading-tight py-0.5 break-words",
27428
27435
  children: serverError
@@ -28584,7 +28591,10 @@ function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, mute
28584
28591
  let cancelled = false;
28585
28592
  const tick = async () => {
28586
28593
  const sid = activeSessionIdRef.current;
28587
- if (sid === null) return;
28594
+ if (sid === null) {
28595
+ setServerDebugError("no session id on this player yet — nothing to ask the server about");
28596
+ return;
28597
+ }
28588
28598
  try {
28589
28599
  const answer = await getSessionDebug(sid);
28590
28600
  if (cancelled) return;
@@ -51048,7 +51058,7 @@ function ImageOffIcon({ className }) {
51048
51058
  ]
51049
51059
  });
51050
51060
  }
51051
- function StreamPanel({ serverUrl, createSession, sendAnswer, handleOffer, getIceServers, addIceCandidate, getIceCandidates, closeSession, getSessionState, playbackUrl, playbackAuthToken, onExitPlayback, posterUrl, streams, activeStreamId: controlledStreamId, onStreamChange, deviceName, phase, pipelineMetrics, detections, stationaryObjects, defaultShowDetections = true, defaultShowMotion = false, streamStats, autoPlay = false, showPlayStop = false, snapshotSrc, snapshotLoading = false, onRefreshSnapshot, showStreamStats = false, children, extraOverlay, ptzAvailable = false, ptzShown = false, ptzOverlay, onPtzToggle, intercomAvailable = false, intercomShown = false, onIntercomToggle, chromeless = false, className }) {
51061
+ function StreamPanel({ serverUrl, createSession, sendAnswer, handleOffer, getIceServers, addIceCandidate, getIceCandidates, closeSession, getSessionState, getSessionDebug, playbackUrl, playbackAuthToken, onExitPlayback, posterUrl, streams, activeStreamId: controlledStreamId, onStreamChange, deviceName, phase, pipelineMetrics, detections, stationaryObjects, defaultShowDetections = true, defaultShowMotion = false, streamStats, autoPlay = false, showPlayStop = false, snapshotSrc, snapshotLoading = false, onRefreshSnapshot, showStreamStats = false, children, extraOverlay, ptzAvailable = false, ptzShown = false, ptzOverlay, onPtzToggle, intercomAvailable = false, intercomShown = false, onIntercomToggle, chromeless = false, className }) {
51052
51062
  const registeredButtons = usePlayerToolbarButtons();
51053
51063
  const recordedPlayback = useRecordedPlayback();
51054
51064
  const [isPlaying, setIsPlaying] = useState(autoPlay);
@@ -51366,6 +51376,7 @@ function StreamPanel({ serverUrl, createSession, sendAnswer, handleOffer, getIce
51366
51376
  handleOffer: playerHandleOffer,
51367
51377
  reoffer: playerReoffer,
51368
51378
  getSessionState,
51379
+ ...getSessionDebug ? { getSessionDebug } : {},
51369
51380
  getIceServers,
51370
51381
  addIceCandidate,
51371
51382
  getIceCandidates,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/ui-library",
3
- "version": "1.2.183",
3
+ "version": "1.2.185",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",