@camera.ui/browser 0.0.180 → 0.0.182
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 +3 -0
- package/dist/index.js +26 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ import { SchemaConfig } from '@camera.ui/sdk';
|
|
|
85
85
|
import { SecuritySystemProperties } from '@camera.ui/sdk';
|
|
86
86
|
import { SecuritySystemProperty } from '@camera.ui/sdk';
|
|
87
87
|
import { SecuritySystemState } from '@camera.ui/sdk';
|
|
88
|
+
import type { SensorSourceState } from '@camera.ui/sdk';
|
|
88
89
|
import { SensorType } from '@camera.ui/sdk';
|
|
89
90
|
import { ShallowRef } from 'vue';
|
|
90
91
|
import { SirenControlProperties } from '@camera.ui/sdk';
|
|
@@ -1254,6 +1255,8 @@ export declare interface StoredSensorData {
|
|
|
1254
1255
|
boundCameraId?: string;
|
|
1255
1256
|
exposed: boolean;
|
|
1256
1257
|
origin?: string;
|
|
1258
|
+
address?: string;
|
|
1259
|
+
sourceState?: SensorSourceState;
|
|
1257
1260
|
connected: boolean;
|
|
1258
1261
|
properties: Record<string, unknown>;
|
|
1259
1262
|
capabilities: string[];
|
package/dist/index.js
CHANGED
|
@@ -4134,6 +4134,8 @@ function isElementVisible(el) {
|
|
|
4134
4134
|
}
|
|
4135
4135
|
function useCameraStream(options) {
|
|
4136
4136
|
const { activityConfig, autoStart: autoStartOption = true, isolated = false } = options;
|
|
4137
|
+
let effectiveIsolated = isolated;
|
|
4138
|
+
let conflictTimer;
|
|
4137
4139
|
const shouldAutoStart = () => toValue(autoStartOption);
|
|
4138
4140
|
const startDelay = options.startDelay ?? acquireAutoStaggerDelay();
|
|
4139
4141
|
const cleanupFns = [];
|
|
@@ -4239,7 +4241,7 @@ function useCameraStream(options) {
|
|
|
4239
4241
|
if (video.parentElement !== container) container.appendChild(video);
|
|
4240
4242
|
}
|
|
4241
4243
|
function reclaimSharedVideo() {
|
|
4242
|
-
if (
|
|
4244
|
+
if (effectiveIsolated) return;
|
|
4243
4245
|
const container = containerElement.value;
|
|
4244
4246
|
const video = videoElement.value;
|
|
4245
4247
|
if (!container || !video || video.parentElement === container) return;
|
|
@@ -4271,7 +4273,7 @@ function useCameraStream(options) {
|
|
|
4271
4273
|
}
|
|
4272
4274
|
function initialize() {
|
|
4273
4275
|
if (initialized.value) return;
|
|
4274
|
-
if (
|
|
4276
|
+
if (effectiveIsolated) {
|
|
4275
4277
|
initializeIsolated();
|
|
4276
4278
|
return;
|
|
4277
4279
|
}
|
|
@@ -4279,6 +4281,27 @@ function useCameraStream(options) {
|
|
|
4279
4281
|
const camName = cameraName.value;
|
|
4280
4282
|
const camDevice = resolvedCameraDevice.value;
|
|
4281
4283
|
if (!container || !camName || !isConnected.value) return;
|
|
4284
|
+
const existing = streamManager.get(camName);
|
|
4285
|
+
if (existing && existing.refCount > 0) {
|
|
4286
|
+
const activeHost = existing.containerElementRef.value;
|
|
4287
|
+
if (activeHost && activeHost !== container && isElementVisible(activeHost)) {
|
|
4288
|
+
if (!conflictTimer) {
|
|
4289
|
+
conflictTimer = setTimeout(() => {
|
|
4290
|
+
conflictTimer = void 0;
|
|
4291
|
+
if (cleanedUp.value || initialized.value) return;
|
|
4292
|
+
const entry = streamManager.get(camName);
|
|
4293
|
+
const host = entry?.containerElementRef.value;
|
|
4294
|
+
if (entry && entry.refCount > 0 && host && host !== containerElement.value && isElementVisible(host)) effectiveIsolated = true;
|
|
4295
|
+
initialize();
|
|
4296
|
+
}, 200);
|
|
4297
|
+
cleanupFns.push(() => {
|
|
4298
|
+
if (conflictTimer) clearTimeout(conflictTimer);
|
|
4299
|
+
conflictTimer = void 0;
|
|
4300
|
+
});
|
|
4301
|
+
}
|
|
4302
|
+
return;
|
|
4303
|
+
}
|
|
4304
|
+
}
|
|
4282
4305
|
const cached = streamManager.acquire(camName, containerElement);
|
|
4283
4306
|
if (cached) {
|
|
4284
4307
|
initialized.value = true;
|
|
@@ -4453,7 +4476,7 @@ function useCameraStream(options) {
|
|
|
4453
4476
|
if (video) video.muted = true;
|
|
4454
4477
|
for (const stopFn of cleanupFns) stopFn();
|
|
4455
4478
|
cleanupFns.length = 0;
|
|
4456
|
-
if (
|
|
4479
|
+
if (effectiveIsolated) ownedConnection?.destroy();
|
|
4457
4480
|
else {
|
|
4458
4481
|
const camName = registeredCamName;
|
|
4459
4482
|
const video = videoElement.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camera.ui/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.182",
|
|
4
4
|
"description": "camera.ui browser client",
|
|
5
5
|
"author": "seydx (https://github.com/cameraui/clients)",
|
|
6
6
|
"type": "module",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@camera.ui/logger": "file:../../packages/logger",
|
|
41
|
-
"@camera.ui/rpc": "^1.0.
|
|
41
|
+
"@camera.ui/rpc": "^1.0.12",
|
|
42
42
|
"@camera.ui/sdk": "~1.2.35",
|
|
43
43
|
"@camera.ui/transport": "file:../../packages/transport",
|
|
44
44
|
"@eneris/push-receiver": "^4.3.1",
|