From 5772641972af90e2dc2f69dde810bea49b42e279 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Fri, 10 Dec 2021 20:45:37 -0800 Subject: [PATCH] core: fix svg ocverlay on video only devices --- plugins/core/package-lock.json | 4 +- plugins/core/package.json | 2 +- plugins/core/ui/src/interfaces/Camera.vue | 24 ++++--- .../core/ui/src/interfaces/VideoCamera.vue | 63 ++----------------- 4 files changed, 21 insertions(+), 72 deletions(-) diff --git a/plugins/core/package-lock.json b/plugins/core/package-lock.json index 0f5fd463f..20e90640a 100644 --- a/plugins/core/package-lock.json +++ b/plugins/core/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/core", - "version": "0.0.151", + "version": "0.0.152", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/core", - "version": "0.0.151", + "version": "0.0.152", "license": "Apache-2.0", "dependencies": { "@koush/wrtc": "^0.5.0", diff --git a/plugins/core/package.json b/plugins/core/package.json index d0bd227bf..1436d8954 100644 --- a/plugins/core/package.json +++ b/plugins/core/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/core", - "version": "0.0.151", + "version": "0.0.152", "description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.", "author": "Scrypted", "license": "Apache-2.0", diff --git a/plugins/core/ui/src/interfaces/Camera.vue b/plugins/core/ui/src/interfaces/Camera.vue index 4680ba274..2f5d1eed5 100644 --- a/plugins/core/ui/src/interfaces/Camera.vue +++ b/plugins/core/ui/src/interfaces/Camera.vue @@ -31,10 +31,12 @@ export default { mixins: [RPCInterface], data() { return { - lastDetection: null, + lastDetection: {}, objectListener: this.device.listen( ScryptedInterface.ObjectDetector, - (s, d, e) => (this.lastDetection = e) + (s, d, e) => { + this.lastDetection = e || {}; + } ), pc: undefined, src: "images/cameraloading.jpg", @@ -63,10 +65,11 @@ export default { const h = detection.boundingBox[3]; const t = detection.className; const fs = 20; - const box = - ` - ${t} - ${t}`; + const box = ` + ${t} + ${t}`; contents += box; } @@ -79,10 +82,11 @@ export default { const h = detection.boundingBox[3]; const t = detection.label; const fs = 20; - const box = - ` - ${t} - ${t}`; + const box = ` + ${t} + ${t}`; contents += box; } diff --git a/plugins/core/ui/src/interfaces/VideoCamera.vue b/plugins/core/ui/src/interfaces/VideoCamera.vue index bb61635b8..197ffb6f0 100644 --- a/plugins/core/ui/src/interfaces/VideoCamera.vue +++ b/plugins/core/ui/src/interfaces/VideoCamera.vue @@ -1,65 +1,10 @@ - -