@camera.ui/browser 0.0.174 → 0.0.176

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.
package/dist/index.d.ts CHANGED
@@ -292,6 +292,7 @@ export declare interface CoreManagerInterface {
292
292
  getCloudServerId(): Promise<string>;
293
293
  getPlugin(pluginName: string): Promise<HostPluginInfo | undefined>;
294
294
  getPluginsByInterface(interfaceName: PluginInterface): Promise<HostPluginInfo[]>;
295
+ getFloorPlan(): Promise<FloorPlan>;
295
296
  }
296
297
 
297
298
  export declare interface CoreManagerNamespaces {
@@ -322,6 +323,83 @@ export declare function createSensorManager(rpcOrContext: RPCClient | ReactiveCa
322
323
  declare interface DBCamera extends BaseCamera {
323
324
  sources: CameraInputSettings[];
324
325
  workerAgentId?: string;
326
+ roomId: string | null;
327
+ }
328
+
329
+ declare interface DBFloorPlan {
330
+ version: number;
331
+ updatedAt: number;
332
+ north: number | null;
333
+ rooms: DBFloorPlanRoom[];
334
+ connections: DBFloorPlanConnection[];
335
+ cameras: DBFloorPlanCamera[];
336
+ sensors: DBFloorPlanSensor[];
337
+ }
338
+
339
+ declare interface DBFloorPlanCamera {
340
+ cameraId: string;
341
+ roomId: string;
342
+ note: string;
343
+ x: number;
344
+ y: number;
345
+ rotation: number;
346
+ fov: number;
347
+ range: number;
348
+ }
349
+
350
+ declare interface DBFloorPlanConnection {
351
+ id: string;
352
+ fromRoomId: string;
353
+ toRoomId: string;
354
+ fromShapeId: string | null;
355
+ toShapeId: string | null;
356
+ offset: number | null;
357
+ width: number;
358
+ note: string;
359
+ type: DBFloorPlanConnectionType;
360
+ }
361
+
362
+ declare type DBFloorPlanConnectionType = 'door' | 'opening' | 'stairs';
363
+
364
+ declare interface DBFloorPlanRoom {
365
+ id: string;
366
+ roomId: string;
367
+ x: number;
368
+ y: number;
369
+ width: number;
370
+ height: number;
371
+ }
372
+
373
+ declare interface DBFloorPlanSensor {
374
+ sensorId: string;
375
+ sensorType: string;
376
+ roomId: string;
377
+ connectionId: string | null;
378
+ note: string;
379
+ x: number;
380
+ y: number;
381
+ }
382
+
383
+ declare interface DBLevel {
384
+ id: string;
385
+ name: string;
386
+ order: number;
387
+ }
388
+
389
+ declare interface DBRoom {
390
+ id: string;
391
+ name: string;
392
+ levelId: string | null;
393
+ outdoor: boolean;
394
+ publicSpace: boolean;
395
+ note: string;
396
+ }
397
+
398
+ declare interface DBRoomCatalog {
399
+ version: number;
400
+ updatedAt: number;
401
+ levels: DBLevel[];
402
+ rooms: DBRoom[];
325
403
  }
326
404
 
327
405
  declare interface DetectionEventNamespaces {
@@ -354,6 +432,11 @@ declare interface DownloadManagerNamespaces {
354
432
 
355
433
  /* Excluded from this release type: FaceSensorProperties */
356
434
 
435
+ declare interface FloorPlan {
436
+ rooms: DBRoomCatalog;
437
+ plan: DBFloorPlan;
438
+ }
439
+
357
440
  declare interface FrameWorkerDetectionNamespaces {
358
441
  detectionRpc: string;
359
442
  }
package/dist/index.js CHANGED
@@ -3018,7 +3018,6 @@ var StreamConnection = class {
3018
3018
  containerElement;
3019
3019
  target;
3020
3020
  isReady;
3021
- effectiveMode;
3022
3021
  triedSourceIds = /* @__PURE__ */ new Set();
3023
3022
  options;
3024
3023
  wsTransport;
@@ -3078,10 +3077,6 @@ var StreamConnection = class {
3078
3077
  this.videoElement = computed(() => toValue(options.videoElement));
3079
3078
  this.containerElement = computed(() => toValue(options.containerElement));
3080
3079
  this.isReady = computed(() => !!this.camera.value && !!this.videoElement.value && !!this.target.value);
3081
- this.effectiveMode = computed(() => {
3082
- if (this.requestedMode.value === "auto") return this.activeMode.value;
3083
- return this.requestedMode.value;
3084
- });
3085
3080
  this.scope.run(() => {
3086
3081
  const { onTabPaused, onTabVisible } = useTabVisibility();
3087
3082
  const wsConnectTimeout = useTimeoutFn(() => {
@@ -3102,7 +3097,7 @@ var StreamConnection = class {
3102
3097
  this.markSourceUndecodable();
3103
3098
  this.restart();
3104
3099
  }
3105
- } else if (this.status.value === "connected" && !this.isPlaying.value && !this.abortController.signal.aborted && this.sourceLikelyH265()) this.handleNoFramesWhileConnected();
3100
+ } else if (this.status.value === "connected" && !this.isPlaying.value && !this.abortController.signal.aborted) this.handleNoFramesWhileConnected();
3106
3101
  }, STREAM_CONFIG.WEBRTC.CONNECT_TIMEOUT, { immediate: false });
3107
3102
  const mseConnectTimeout = useTimeoutFn(() => {
3108
3103
  if (this.abortController.signal.aborted || this.status.value === "connected" || this.status.value === "closed") return;
@@ -3532,7 +3527,15 @@ var StreamConnection = class {
3532
3527
  this.triedSourceIds.add(src._id);
3533
3528
  }
3534
3529
  handleNoFramesWhileConnected() {
3535
- reportH265DecodeFailure(this.activeMode.value === "mse" ? "mse" : "webrtc");
3530
+ if (this.sourceLikelyH265()) reportH265DecodeFailure(this.activeMode.value === "mse" ? "mse" : "webrtc");
3531
+ if (this.requestedMode.value === "auto" && this.activeMode.value !== "mse") {
3532
+ this.webrtcHandler?.close();
3533
+ this.webrtcHandler = void 0;
3534
+ this.activeMode.value = "mse";
3535
+ this.status.value = "reconnecting";
3536
+ this.startMSE();
3537
+ return;
3538
+ }
3536
3539
  this.markSourceUndecodable();
3537
3540
  this.restart();
3538
3541
  }
@@ -3589,10 +3592,10 @@ var StreamConnection = class {
3589
3592
  if (this.abortController.signal.aborted) return;
3590
3593
  this.stopWsConnectTimeout();
3591
3594
  this.status.value = "connecting";
3592
- const mode = this.effectiveMode.value;
3593
- if (mode === "webrtc" || mode === "webrtc/tcp") this.startWebRTC(mode);
3595
+ const mode = this.requestedMode.value;
3596
+ if (mode === "auto") this.startAutoMode();
3597
+ else if (mode === "webrtc" || mode === "webrtc/tcp") this.startWebRTC(mode);
3594
3598
  else if (mode === "mse") this.startMSE();
3595
- else if (this.requestedMode.value === "auto") this.startAutoMode();
3596
3599
  }
3597
3600
  handleWsClose() {
3598
3601
  if (this.status.value !== "closed" && !this.abortController.signal.aborted) this.startReconnectTimeout();
@@ -3652,6 +3655,10 @@ var StreamConnection = class {
3652
3655
  if (this.abortController.signal.aborted) return;
3653
3656
  const video = this.videoElement.value;
3654
3657
  if (!video) return;
3658
+ if (this.hasVideo.value && stream.getVideoTracks().length === 0) {
3659
+ this.handleWebRTCFailed();
3660
+ return;
3661
+ }
3655
3662
  this.activeMode.value = this.requestedMode.value === "auto" ? "webrtc" : this.requestedMode.value;
3656
3663
  this.lastMediaStream = stream;
3657
3664
  video.srcObject = stream;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.0.174",
3
+ "version": "0.0.176",
4
4
  "description": "camera.ui browser client",
5
5
  "author": "seydx (https://github.com/cameraui/clients)",
6
6
  "type": "module",
@@ -39,13 +39,13 @@
39
39
  "devDependencies": {
40
40
  "@camera.ui/logger": "file:../../packages/logger",
41
41
  "@camera.ui/rpc": "^1.0.11",
42
- "@camera.ui/sdk": "~1.2.31",
42
+ "@camera.ui/sdk": "~1.2.32",
43
43
  "@camera.ui/transport": "file:../../packages/transport",
44
44
  "@eneris/push-receiver": "^4.3.1",
45
45
  "@microsoft/api-extractor": "^7.59.0",
46
46
  "@stylistic/eslint-plugin": "^5.10.0",
47
47
  "@types/webrtc": "^0.0.47",
48
- "@typescript-eslint/parser": "^8.67.0",
48
+ "@typescript-eslint/parser": "^8.68.0",
49
49
  "@vitejs/plugin-vue": "^6.0.8",
50
50
  "@vue/eslint-config-prettier": "^10.2.0",
51
51
  "@vue/eslint-config-typescript": "^14.9.0",
@@ -59,9 +59,9 @@
59
59
  "prettier": "^3.9.6",
60
60
  "rimraf": "^6.1.3",
61
61
  "typescript": "5.9.3",
62
- "typescript-eslint": "^8.67.0",
62
+ "typescript-eslint": "^8.68.0",
63
63
  "unplugin-dts": "^1.0.3",
64
- "updates": "^18.0.5",
64
+ "updates": "^18.0.7",
65
65
  "vite": "^8.2.2",
66
66
  "vitest": "^4.1.11",
67
67
  "vue": "^3.5.41",