inl-ui 0.1.130 → 0.1.132
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/components/index.cjs +56 -13
- package/dist/components/index.js +56 -13
- package/dist/index.cjs +57 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +57 -14
- package/dist/video/index.cjs +56 -13
- package/dist/video/index.js +58 -15
- package/package.json +1 -1
|
@@ -9703,6 +9703,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
9703
9703
|
},
|
|
9704
9704
|
emits: ["close", "change"],
|
|
9705
9705
|
setup(_prop, _context) {
|
|
9706
|
+
const videoBoxRef = vue.ref();
|
|
9706
9707
|
const player = vue.ref();
|
|
9707
9708
|
const cameraConfig = vue.ref({});
|
|
9708
9709
|
const streamHistory = vue.ref("");
|
|
@@ -9994,6 +9995,15 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
9994
9995
|
};
|
|
9995
9996
|
let Mqtt = null;
|
|
9996
9997
|
const topic = vue.ref("");
|
|
9998
|
+
const {
|
|
9999
|
+
isFullscreen,
|
|
10000
|
+
enter,
|
|
10001
|
+
exit,
|
|
10002
|
+
toggle
|
|
10003
|
+
} = core.useFullscreen(videoBoxRef);
|
|
10004
|
+
vue.watch(() => isFullscreen.value, val => {
|
|
10005
|
+
clearFlogCanvas();
|
|
10006
|
+
});
|
|
9997
10007
|
const initMqtt = async ip => {
|
|
9998
10008
|
Mqtt = await useMqtt();
|
|
9999
10009
|
topic.value = `vlm/${ip}`;
|
|
@@ -10008,15 +10018,27 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10008
10018
|
});
|
|
10009
10019
|
Mqtt.on("message", onMtMessageFn);
|
|
10010
10020
|
};
|
|
10011
|
-
const onMtMessageFn = (
|
|
10021
|
+
const onMtMessageFn = (topicStr, message2) => {
|
|
10022
|
+
if (topicStr !== topic.value) {
|
|
10023
|
+
return;
|
|
10024
|
+
}
|
|
10012
10025
|
const msg = new TextDecoder("utf-8").decode(message2);
|
|
10013
10026
|
console.log("msg", JSON.parse(msg));
|
|
10014
10027
|
drawFlog(JSON.parse(msg));
|
|
10015
10028
|
};
|
|
10016
10029
|
let canvasDom = null;
|
|
10017
10030
|
let textBox = null;
|
|
10018
|
-
const createFlogCanvas = () => {
|
|
10031
|
+
const createFlogCanvas = async () => {
|
|
10032
|
+
await vue.nextTick();
|
|
10019
10033
|
const box = document.getElementById("videoBox_" + uuid.value);
|
|
10034
|
+
if (!box) {
|
|
10035
|
+
return {
|
|
10036
|
+
canvas: null,
|
|
10037
|
+
textBox: null,
|
|
10038
|
+
width: 0,
|
|
10039
|
+
height: 0
|
|
10040
|
+
};
|
|
10041
|
+
}
|
|
10020
10042
|
if (!canvasDom) {
|
|
10021
10043
|
canvasDom = document.createElement("canvas");
|
|
10022
10044
|
canvasDom.id = "canvas_" + uuid.value;
|
|
@@ -10035,7 +10057,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10035
10057
|
textBox.style.position = "absolute";
|
|
10036
10058
|
textBox.style.width = "100%";
|
|
10037
10059
|
textBox.style.left = "0";
|
|
10038
|
-
textBox.style.zIndex = "
|
|
10060
|
+
textBox.style.zIndex = "1000";
|
|
10039
10061
|
textBox.style.pointerEvents = "none";
|
|
10040
10062
|
box.appendChild(textBox);
|
|
10041
10063
|
}
|
|
@@ -10046,14 +10068,31 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10046
10068
|
height: box.offsetHeight
|
|
10047
10069
|
};
|
|
10048
10070
|
};
|
|
10071
|
+
const clearFlogCanvas = () => {
|
|
10072
|
+
if (canvasDom) {
|
|
10073
|
+
canvasDom.remove();
|
|
10074
|
+
canvasDom = null;
|
|
10075
|
+
}
|
|
10076
|
+
if (textBox) {
|
|
10077
|
+
textBox.remove();
|
|
10078
|
+
textBox = null;
|
|
10079
|
+
}
|
|
10080
|
+
if (drawCleanTimer) {
|
|
10081
|
+
clearTimeout(drawCleanTimer);
|
|
10082
|
+
drawCleanTimer = null;
|
|
10083
|
+
}
|
|
10084
|
+
};
|
|
10049
10085
|
let drawCleanTimer = null;
|
|
10050
|
-
const drawFlog = data => {
|
|
10086
|
+
const drawFlog = async data => {
|
|
10051
10087
|
let {
|
|
10052
10088
|
canvasDom: canvasDom2,
|
|
10053
10089
|
width,
|
|
10054
10090
|
height,
|
|
10055
10091
|
textBox: textBox2
|
|
10056
|
-
} = createFlogCanvas();
|
|
10092
|
+
} = await createFlogCanvas();
|
|
10093
|
+
if (!canvasDom2) {
|
|
10094
|
+
return;
|
|
10095
|
+
}
|
|
10057
10096
|
const ctx = canvasDom2.getContext("2d");
|
|
10058
10097
|
if (drawCleanTimer) {
|
|
10059
10098
|
clearTimeout(drawCleanTimer);
|
|
@@ -10070,12 +10109,12 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10070
10109
|
});
|
|
10071
10110
|
}
|
|
10072
10111
|
if (data.text) {
|
|
10073
|
-
const fontSize =
|
|
10112
|
+
const fontSize = 16 * width / 800;
|
|
10074
10113
|
const margin = 10;
|
|
10075
10114
|
const marginTop = height * 0.1 + margin;
|
|
10076
10115
|
textBox2.innerHTML = data.text;
|
|
10077
10116
|
textBox2.style.top = marginTop + "px";
|
|
10078
|
-
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.
|
|
10117
|
+
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.8)";
|
|
10079
10118
|
textBox2.style.color = data.text_color || "red";
|
|
10080
10119
|
textBox2.style.fontSize = `${fontSize}px`;
|
|
10081
10120
|
textBox2.style.padding = `${margin}px`;
|
|
@@ -10095,7 +10134,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10095
10134
|
const vlmSwitchKey = vue.computed(() => {
|
|
10096
10135
|
return `showVlmInfo_${camera.value?.uuid}`;
|
|
10097
10136
|
});
|
|
10098
|
-
vue.watchEffect(() => {
|
|
10137
|
+
vue.watchEffect(async () => {
|
|
10099
10138
|
if (showVlmInfo.value) {
|
|
10100
10139
|
localStorage.removeItem(vlmSwitchKey.value);
|
|
10101
10140
|
} else {
|
|
@@ -10105,7 +10144,10 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10105
10144
|
textBox: textBox2,
|
|
10106
10145
|
width,
|
|
10107
10146
|
height
|
|
10108
|
-
} = createFlogCanvas();
|
|
10147
|
+
} = await createFlogCanvas();
|
|
10148
|
+
if (!canvasDom2) {
|
|
10149
|
+
return;
|
|
10150
|
+
}
|
|
10109
10151
|
const ctx = canvasDom2.getContext("2d");
|
|
10110
10152
|
clearTimeout(drawCleanTimer);
|
|
10111
10153
|
removeTxtBox();
|
|
@@ -10114,7 +10156,8 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10114
10156
|
});
|
|
10115
10157
|
return () => vue.createVNode("div", {
|
|
10116
10158
|
"id": "videoBox_" + uuid.value,
|
|
10117
|
-
"class": ["videoBox", _prop.alarm ? "alarm" : ""]
|
|
10159
|
+
"class": ["videoBox", _prop.alarm ? "alarm" : ""],
|
|
10160
|
+
"ref": videoBoxRef
|
|
10118
10161
|
}, [camera.value ? vue.createVNode(VideoPlayerV2, {
|
|
10119
10162
|
"ref": player,
|
|
10120
10163
|
"domId": uuid.value,
|
|
@@ -10157,7 +10200,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10157
10200
|
}, [vue.createVNode("div", null, [info.name ? `${info.name}\uFF1A` : ""]), vue.createVNode("div", {
|
|
10158
10201
|
"class": "value"
|
|
10159
10202
|
}, [info.displayValue && info.displayValue !== "null" ? info.displayValue + " " : ""]), vue.createVNode("div", null, [info.unit])]);
|
|
10160
|
-
})]) : "", vue.createVNode("div", {
|
|
10203
|
+
})]) : "", vue.withDirectives(vue.createVNode("div", {
|
|
10161
10204
|
"class": "footer-min",
|
|
10162
10205
|
"id": "footer_" + uuid.value
|
|
10163
10206
|
}, [vue.createVNode("div", {
|
|
@@ -10303,7 +10346,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10303
10346
|
return vue.createVNode("img", {
|
|
10304
10347
|
"onClick": e => {
|
|
10305
10348
|
e.stopPropagation();
|
|
10306
|
-
|
|
10349
|
+
toggle();
|
|
10307
10350
|
},
|
|
10308
10351
|
"src": "/micro-assets/inl/video/putUp.png"
|
|
10309
10352
|
}, null);
|
|
@@ -10316,7 +10359,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10316
10359
|
}, null);
|
|
10317
10360
|
}
|
|
10318
10361
|
}
|
|
10319
|
-
})])]), renderChangeCamera()]);
|
|
10362
|
+
})])]), [[vue.vShow, !isFullscreen.value]]), renderChangeCamera()]);
|
|
10320
10363
|
}
|
|
10321
10364
|
});
|
|
10322
10365
|
var VideoBoxV2$1 = installComponent(VideoBoxV2, "video-box-v2");
|
package/dist/components/index.js
CHANGED
|
@@ -9674,6 +9674,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
9674
9674
|
},
|
|
9675
9675
|
emits: ["close", "change"],
|
|
9676
9676
|
setup(_prop, _context) {
|
|
9677
|
+
const videoBoxRef = ref();
|
|
9677
9678
|
const player = ref();
|
|
9678
9679
|
const cameraConfig = ref({});
|
|
9679
9680
|
const streamHistory = ref("");
|
|
@@ -9965,6 +9966,15 @@ const VideoBoxV2 = defineComponent({
|
|
|
9965
9966
|
};
|
|
9966
9967
|
let Mqtt = null;
|
|
9967
9968
|
const topic = ref("");
|
|
9969
|
+
const {
|
|
9970
|
+
isFullscreen,
|
|
9971
|
+
enter,
|
|
9972
|
+
exit,
|
|
9973
|
+
toggle
|
|
9974
|
+
} = useFullscreen(videoBoxRef);
|
|
9975
|
+
watch(() => isFullscreen.value, val => {
|
|
9976
|
+
clearFlogCanvas();
|
|
9977
|
+
});
|
|
9968
9978
|
const initMqtt = async ip => {
|
|
9969
9979
|
Mqtt = await useMqtt();
|
|
9970
9980
|
topic.value = `vlm/${ip}`;
|
|
@@ -9979,15 +9989,27 @@ const VideoBoxV2 = defineComponent({
|
|
|
9979
9989
|
});
|
|
9980
9990
|
Mqtt.on("message", onMtMessageFn);
|
|
9981
9991
|
};
|
|
9982
|
-
const onMtMessageFn = (
|
|
9992
|
+
const onMtMessageFn = (topicStr, message2) => {
|
|
9993
|
+
if (topicStr !== topic.value) {
|
|
9994
|
+
return;
|
|
9995
|
+
}
|
|
9983
9996
|
const msg = new TextDecoder("utf-8").decode(message2);
|
|
9984
9997
|
console.log("msg", JSON.parse(msg));
|
|
9985
9998
|
drawFlog(JSON.parse(msg));
|
|
9986
9999
|
};
|
|
9987
10000
|
let canvasDom = null;
|
|
9988
10001
|
let textBox = null;
|
|
9989
|
-
const createFlogCanvas = () => {
|
|
10002
|
+
const createFlogCanvas = async () => {
|
|
10003
|
+
await nextTick();
|
|
9990
10004
|
const box = document.getElementById("videoBox_" + uuid.value);
|
|
10005
|
+
if (!box) {
|
|
10006
|
+
return {
|
|
10007
|
+
canvas: null,
|
|
10008
|
+
textBox: null,
|
|
10009
|
+
width: 0,
|
|
10010
|
+
height: 0
|
|
10011
|
+
};
|
|
10012
|
+
}
|
|
9991
10013
|
if (!canvasDom) {
|
|
9992
10014
|
canvasDom = document.createElement("canvas");
|
|
9993
10015
|
canvasDom.id = "canvas_" + uuid.value;
|
|
@@ -10006,7 +10028,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
10006
10028
|
textBox.style.position = "absolute";
|
|
10007
10029
|
textBox.style.width = "100%";
|
|
10008
10030
|
textBox.style.left = "0";
|
|
10009
|
-
textBox.style.zIndex = "
|
|
10031
|
+
textBox.style.zIndex = "1000";
|
|
10010
10032
|
textBox.style.pointerEvents = "none";
|
|
10011
10033
|
box.appendChild(textBox);
|
|
10012
10034
|
}
|
|
@@ -10017,14 +10039,31 @@ const VideoBoxV2 = defineComponent({
|
|
|
10017
10039
|
height: box.offsetHeight
|
|
10018
10040
|
};
|
|
10019
10041
|
};
|
|
10042
|
+
const clearFlogCanvas = () => {
|
|
10043
|
+
if (canvasDom) {
|
|
10044
|
+
canvasDom.remove();
|
|
10045
|
+
canvasDom = null;
|
|
10046
|
+
}
|
|
10047
|
+
if (textBox) {
|
|
10048
|
+
textBox.remove();
|
|
10049
|
+
textBox = null;
|
|
10050
|
+
}
|
|
10051
|
+
if (drawCleanTimer) {
|
|
10052
|
+
clearTimeout(drawCleanTimer);
|
|
10053
|
+
drawCleanTimer = null;
|
|
10054
|
+
}
|
|
10055
|
+
};
|
|
10020
10056
|
let drawCleanTimer = null;
|
|
10021
|
-
const drawFlog = data => {
|
|
10057
|
+
const drawFlog = async data => {
|
|
10022
10058
|
let {
|
|
10023
10059
|
canvasDom: canvasDom2,
|
|
10024
10060
|
width,
|
|
10025
10061
|
height,
|
|
10026
10062
|
textBox: textBox2
|
|
10027
|
-
} = createFlogCanvas();
|
|
10063
|
+
} = await createFlogCanvas();
|
|
10064
|
+
if (!canvasDom2) {
|
|
10065
|
+
return;
|
|
10066
|
+
}
|
|
10028
10067
|
const ctx = canvasDom2.getContext("2d");
|
|
10029
10068
|
if (drawCleanTimer) {
|
|
10030
10069
|
clearTimeout(drawCleanTimer);
|
|
@@ -10041,12 +10080,12 @@ const VideoBoxV2 = defineComponent({
|
|
|
10041
10080
|
});
|
|
10042
10081
|
}
|
|
10043
10082
|
if (data.text) {
|
|
10044
|
-
const fontSize =
|
|
10083
|
+
const fontSize = 16 * width / 800;
|
|
10045
10084
|
const margin = 10;
|
|
10046
10085
|
const marginTop = height * 0.1 + margin;
|
|
10047
10086
|
textBox2.innerHTML = data.text;
|
|
10048
10087
|
textBox2.style.top = marginTop + "px";
|
|
10049
|
-
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.
|
|
10088
|
+
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.8)";
|
|
10050
10089
|
textBox2.style.color = data.text_color || "red";
|
|
10051
10090
|
textBox2.style.fontSize = `${fontSize}px`;
|
|
10052
10091
|
textBox2.style.padding = `${margin}px`;
|
|
@@ -10066,7 +10105,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
10066
10105
|
const vlmSwitchKey = computed(() => {
|
|
10067
10106
|
return `showVlmInfo_${camera.value?.uuid}`;
|
|
10068
10107
|
});
|
|
10069
|
-
watchEffect(() => {
|
|
10108
|
+
watchEffect(async () => {
|
|
10070
10109
|
if (showVlmInfo.value) {
|
|
10071
10110
|
localStorage.removeItem(vlmSwitchKey.value);
|
|
10072
10111
|
} else {
|
|
@@ -10076,7 +10115,10 @@ const VideoBoxV2 = defineComponent({
|
|
|
10076
10115
|
textBox: textBox2,
|
|
10077
10116
|
width,
|
|
10078
10117
|
height
|
|
10079
|
-
} = createFlogCanvas();
|
|
10118
|
+
} = await createFlogCanvas();
|
|
10119
|
+
if (!canvasDom2) {
|
|
10120
|
+
return;
|
|
10121
|
+
}
|
|
10080
10122
|
const ctx = canvasDom2.getContext("2d");
|
|
10081
10123
|
clearTimeout(drawCleanTimer);
|
|
10082
10124
|
removeTxtBox();
|
|
@@ -10085,7 +10127,8 @@ const VideoBoxV2 = defineComponent({
|
|
|
10085
10127
|
});
|
|
10086
10128
|
return () => createVNode("div", {
|
|
10087
10129
|
"id": "videoBox_" + uuid.value,
|
|
10088
|
-
"class": ["videoBox", _prop.alarm ? "alarm" : ""]
|
|
10130
|
+
"class": ["videoBox", _prop.alarm ? "alarm" : ""],
|
|
10131
|
+
"ref": videoBoxRef
|
|
10089
10132
|
}, [camera.value ? createVNode(VideoPlayerV2, {
|
|
10090
10133
|
"ref": player,
|
|
10091
10134
|
"domId": uuid.value,
|
|
@@ -10128,7 +10171,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
10128
10171
|
}, [createVNode("div", null, [info.name ? `${info.name}\uFF1A` : ""]), createVNode("div", {
|
|
10129
10172
|
"class": "value"
|
|
10130
10173
|
}, [info.displayValue && info.displayValue !== "null" ? info.displayValue + " " : ""]), createVNode("div", null, [info.unit])]);
|
|
10131
|
-
})]) : "", createVNode("div", {
|
|
10174
|
+
})]) : "", withDirectives(createVNode("div", {
|
|
10132
10175
|
"class": "footer-min",
|
|
10133
10176
|
"id": "footer_" + uuid.value
|
|
10134
10177
|
}, [createVNode("div", {
|
|
@@ -10274,7 +10317,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
10274
10317
|
return createVNode("img", {
|
|
10275
10318
|
"onClick": e => {
|
|
10276
10319
|
e.stopPropagation();
|
|
10277
|
-
|
|
10320
|
+
toggle();
|
|
10278
10321
|
},
|
|
10279
10322
|
"src": "/micro-assets/inl/video/putUp.png"
|
|
10280
10323
|
}, null);
|
|
@@ -10287,7 +10330,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
10287
10330
|
}, null);
|
|
10288
10331
|
}
|
|
10289
10332
|
}
|
|
10290
|
-
})])]), renderChangeCamera()]);
|
|
10333
|
+
})])]), [[vShow, !isFullscreen.value]]), renderChangeCamera()]);
|
|
10291
10334
|
}
|
|
10292
10335
|
});
|
|
10293
10336
|
var VideoBoxV2$1 = installComponent(VideoBoxV2, "video-box-v2");
|
package/dist/index.cjs
CHANGED
|
@@ -45,7 +45,7 @@ var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
|
45
45
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
46
46
|
var mqtt__default = /*#__PURE__*/_interopDefaultLegacy(mqtt);
|
|
47
47
|
|
|
48
|
-
var version = "0.1.
|
|
48
|
+
var version = "0.1.131";
|
|
49
49
|
|
|
50
50
|
const setTheme = theme => {
|
|
51
51
|
if (theme === "dark") {
|
|
@@ -10689,6 +10689,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10689
10689
|
},
|
|
10690
10690
|
emits: ["close", "change"],
|
|
10691
10691
|
setup(_prop, _context) {
|
|
10692
|
+
const videoBoxRef = vue.ref();
|
|
10692
10693
|
const player = vue.ref();
|
|
10693
10694
|
const cameraConfig = vue.ref({});
|
|
10694
10695
|
const streamHistory = vue.ref("");
|
|
@@ -10980,6 +10981,15 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10980
10981
|
};
|
|
10981
10982
|
let Mqtt = null;
|
|
10982
10983
|
const topic = vue.ref("");
|
|
10984
|
+
const {
|
|
10985
|
+
isFullscreen,
|
|
10986
|
+
enter,
|
|
10987
|
+
exit,
|
|
10988
|
+
toggle
|
|
10989
|
+
} = core.useFullscreen(videoBoxRef);
|
|
10990
|
+
vue.watch(() => isFullscreen.value, val => {
|
|
10991
|
+
clearFlogCanvas();
|
|
10992
|
+
});
|
|
10983
10993
|
const initMqtt = async ip => {
|
|
10984
10994
|
Mqtt = await useMqtt();
|
|
10985
10995
|
topic.value = `vlm/${ip}`;
|
|
@@ -10994,15 +11004,27 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
10994
11004
|
});
|
|
10995
11005
|
Mqtt.on("message", onMtMessageFn);
|
|
10996
11006
|
};
|
|
10997
|
-
const onMtMessageFn = (
|
|
11007
|
+
const onMtMessageFn = (topicStr, message2) => {
|
|
11008
|
+
if (topicStr !== topic.value) {
|
|
11009
|
+
return;
|
|
11010
|
+
}
|
|
10998
11011
|
const msg = new TextDecoder("utf-8").decode(message2);
|
|
10999
11012
|
console.log("msg", JSON.parse(msg));
|
|
11000
11013
|
drawFlog(JSON.parse(msg));
|
|
11001
11014
|
};
|
|
11002
11015
|
let canvasDom = null;
|
|
11003
11016
|
let textBox = null;
|
|
11004
|
-
const createFlogCanvas = () => {
|
|
11017
|
+
const createFlogCanvas = async () => {
|
|
11018
|
+
await vue.nextTick();
|
|
11005
11019
|
const box = document.getElementById("videoBox_" + uuid.value);
|
|
11020
|
+
if (!box) {
|
|
11021
|
+
return {
|
|
11022
|
+
canvas: null,
|
|
11023
|
+
textBox: null,
|
|
11024
|
+
width: 0,
|
|
11025
|
+
height: 0
|
|
11026
|
+
};
|
|
11027
|
+
}
|
|
11006
11028
|
if (!canvasDom) {
|
|
11007
11029
|
canvasDom = document.createElement("canvas");
|
|
11008
11030
|
canvasDom.id = "canvas_" + uuid.value;
|
|
@@ -11021,7 +11043,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
11021
11043
|
textBox.style.position = "absolute";
|
|
11022
11044
|
textBox.style.width = "100%";
|
|
11023
11045
|
textBox.style.left = "0";
|
|
11024
|
-
textBox.style.zIndex = "
|
|
11046
|
+
textBox.style.zIndex = "1000";
|
|
11025
11047
|
textBox.style.pointerEvents = "none";
|
|
11026
11048
|
box.appendChild(textBox);
|
|
11027
11049
|
}
|
|
@@ -11032,14 +11054,31 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
11032
11054
|
height: box.offsetHeight
|
|
11033
11055
|
};
|
|
11034
11056
|
};
|
|
11057
|
+
const clearFlogCanvas = () => {
|
|
11058
|
+
if (canvasDom) {
|
|
11059
|
+
canvasDom.remove();
|
|
11060
|
+
canvasDom = null;
|
|
11061
|
+
}
|
|
11062
|
+
if (textBox) {
|
|
11063
|
+
textBox.remove();
|
|
11064
|
+
textBox = null;
|
|
11065
|
+
}
|
|
11066
|
+
if (drawCleanTimer) {
|
|
11067
|
+
clearTimeout(drawCleanTimer);
|
|
11068
|
+
drawCleanTimer = null;
|
|
11069
|
+
}
|
|
11070
|
+
};
|
|
11035
11071
|
let drawCleanTimer = null;
|
|
11036
|
-
const drawFlog = data => {
|
|
11072
|
+
const drawFlog = async data => {
|
|
11037
11073
|
let {
|
|
11038
11074
|
canvasDom: canvasDom2,
|
|
11039
11075
|
width,
|
|
11040
11076
|
height,
|
|
11041
11077
|
textBox: textBox2
|
|
11042
|
-
} = createFlogCanvas();
|
|
11078
|
+
} = await createFlogCanvas();
|
|
11079
|
+
if (!canvasDom2) {
|
|
11080
|
+
return;
|
|
11081
|
+
}
|
|
11043
11082
|
const ctx = canvasDom2.getContext("2d");
|
|
11044
11083
|
if (drawCleanTimer) {
|
|
11045
11084
|
clearTimeout(drawCleanTimer);
|
|
@@ -11056,12 +11095,12 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
11056
11095
|
});
|
|
11057
11096
|
}
|
|
11058
11097
|
if (data.text) {
|
|
11059
|
-
const fontSize =
|
|
11098
|
+
const fontSize = 16 * width / 800;
|
|
11060
11099
|
const margin = 10;
|
|
11061
11100
|
const marginTop = height * 0.1 + margin;
|
|
11062
11101
|
textBox2.innerHTML = data.text;
|
|
11063
11102
|
textBox2.style.top = marginTop + "px";
|
|
11064
|
-
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.
|
|
11103
|
+
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.8)";
|
|
11065
11104
|
textBox2.style.color = data.text_color || "red";
|
|
11066
11105
|
textBox2.style.fontSize = `${fontSize}px`;
|
|
11067
11106
|
textBox2.style.padding = `${margin}px`;
|
|
@@ -11081,7 +11120,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
11081
11120
|
const vlmSwitchKey = vue.computed(() => {
|
|
11082
11121
|
return `showVlmInfo_${camera.value?.uuid}`;
|
|
11083
11122
|
});
|
|
11084
|
-
vue.watchEffect(() => {
|
|
11123
|
+
vue.watchEffect(async () => {
|
|
11085
11124
|
if (showVlmInfo.value) {
|
|
11086
11125
|
localStorage.removeItem(vlmSwitchKey.value);
|
|
11087
11126
|
} else {
|
|
@@ -11091,7 +11130,10 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
11091
11130
|
textBox: textBox2,
|
|
11092
11131
|
width,
|
|
11093
11132
|
height
|
|
11094
|
-
} = createFlogCanvas();
|
|
11133
|
+
} = await createFlogCanvas();
|
|
11134
|
+
if (!canvasDom2) {
|
|
11135
|
+
return;
|
|
11136
|
+
}
|
|
11095
11137
|
const ctx = canvasDom2.getContext("2d");
|
|
11096
11138
|
clearTimeout(drawCleanTimer);
|
|
11097
11139
|
removeTxtBox();
|
|
@@ -11100,7 +11142,8 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
11100
11142
|
});
|
|
11101
11143
|
return () => vue.createVNode("div", {
|
|
11102
11144
|
"id": "videoBox_" + uuid.value,
|
|
11103
|
-
"class": ["videoBox", _prop.alarm ? "alarm" : ""]
|
|
11145
|
+
"class": ["videoBox", _prop.alarm ? "alarm" : ""],
|
|
11146
|
+
"ref": videoBoxRef
|
|
11104
11147
|
}, [camera.value ? vue.createVNode(VideoPlayerV2, {
|
|
11105
11148
|
"ref": player,
|
|
11106
11149
|
"domId": uuid.value,
|
|
@@ -11143,7 +11186,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
11143
11186
|
}, [vue.createVNode("div", null, [info.name ? `${info.name}\uFF1A` : ""]), vue.createVNode("div", {
|
|
11144
11187
|
"class": "value"
|
|
11145
11188
|
}, [info.displayValue && info.displayValue !== "null" ? info.displayValue + " " : ""]), vue.createVNode("div", null, [info.unit])]);
|
|
11146
|
-
})]) : "", vue.createVNode("div", {
|
|
11189
|
+
})]) : "", vue.withDirectives(vue.createVNode("div", {
|
|
11147
11190
|
"class": "footer-min",
|
|
11148
11191
|
"id": "footer_" + uuid.value
|
|
11149
11192
|
}, [vue.createVNode("div", {
|
|
@@ -11289,7 +11332,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
11289
11332
|
return vue.createVNode("img", {
|
|
11290
11333
|
"onClick": e => {
|
|
11291
11334
|
e.stopPropagation();
|
|
11292
|
-
|
|
11335
|
+
toggle();
|
|
11293
11336
|
},
|
|
11294
11337
|
"src": "/micro-assets/inl/video/putUp.png"
|
|
11295
11338
|
}, null);
|
|
@@ -11302,7 +11345,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
11302
11345
|
}, null);
|
|
11303
11346
|
}
|
|
11304
11347
|
}
|
|
11305
|
-
})])]), renderChangeCamera()]);
|
|
11348
|
+
})])]), [[vue.vShow, !isFullscreen.value]]), renderChangeCamera()]);
|
|
11306
11349
|
}
|
|
11307
11350
|
});
|
|
11308
11351
|
var VideoBoxV2$1 = installComponent(VideoBoxV2, "video-box-v2");
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { Key } from 'ant-design-vue/lib/table/interface';
|
|
|
11
11
|
import * as vue_jsx_runtime from 'vue/jsx-runtime';
|
|
12
12
|
import * as _ant_design_icons_vue_lib_components_IconFont from '@ant-design/icons-vue/lib/components/IconFont';
|
|
13
13
|
|
|
14
|
-
var version = "0.1.
|
|
14
|
+
var version = "0.1.131";
|
|
15
15
|
|
|
16
16
|
declare const _default$p: {
|
|
17
17
|
set(theme: string): void;
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { XPopup, CommentBlock, setAxiosOption } from '@sszj-temp/mobile';
|
|
|
14
14
|
import { marked } from 'marked';
|
|
15
15
|
import '@sszj-temp/mobile/style.css';
|
|
16
16
|
|
|
17
|
-
var version = "0.1.
|
|
17
|
+
var version = "0.1.131";
|
|
18
18
|
|
|
19
19
|
const setTheme = theme => {
|
|
20
20
|
if (theme === "dark") {
|
|
@@ -10658,6 +10658,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
10658
10658
|
},
|
|
10659
10659
|
emits: ["close", "change"],
|
|
10660
10660
|
setup(_prop, _context) {
|
|
10661
|
+
const videoBoxRef = ref();
|
|
10661
10662
|
const player = ref();
|
|
10662
10663
|
const cameraConfig = ref({});
|
|
10663
10664
|
const streamHistory = ref("");
|
|
@@ -10949,6 +10950,15 @@ const VideoBoxV2 = defineComponent({
|
|
|
10949
10950
|
};
|
|
10950
10951
|
let Mqtt = null;
|
|
10951
10952
|
const topic = ref("");
|
|
10953
|
+
const {
|
|
10954
|
+
isFullscreen,
|
|
10955
|
+
enter,
|
|
10956
|
+
exit,
|
|
10957
|
+
toggle
|
|
10958
|
+
} = useFullscreen(videoBoxRef);
|
|
10959
|
+
watch(() => isFullscreen.value, val => {
|
|
10960
|
+
clearFlogCanvas();
|
|
10961
|
+
});
|
|
10952
10962
|
const initMqtt = async ip => {
|
|
10953
10963
|
Mqtt = await useMqtt();
|
|
10954
10964
|
topic.value = `vlm/${ip}`;
|
|
@@ -10963,15 +10973,27 @@ const VideoBoxV2 = defineComponent({
|
|
|
10963
10973
|
});
|
|
10964
10974
|
Mqtt.on("message", onMtMessageFn);
|
|
10965
10975
|
};
|
|
10966
|
-
const onMtMessageFn = (
|
|
10976
|
+
const onMtMessageFn = (topicStr, message2) => {
|
|
10977
|
+
if (topicStr !== topic.value) {
|
|
10978
|
+
return;
|
|
10979
|
+
}
|
|
10967
10980
|
const msg = new TextDecoder("utf-8").decode(message2);
|
|
10968
10981
|
console.log("msg", JSON.parse(msg));
|
|
10969
10982
|
drawFlog(JSON.parse(msg));
|
|
10970
10983
|
};
|
|
10971
10984
|
let canvasDom = null;
|
|
10972
10985
|
let textBox = null;
|
|
10973
|
-
const createFlogCanvas = () => {
|
|
10986
|
+
const createFlogCanvas = async () => {
|
|
10987
|
+
await nextTick();
|
|
10974
10988
|
const box = document.getElementById("videoBox_" + uuid.value);
|
|
10989
|
+
if (!box) {
|
|
10990
|
+
return {
|
|
10991
|
+
canvas: null,
|
|
10992
|
+
textBox: null,
|
|
10993
|
+
width: 0,
|
|
10994
|
+
height: 0
|
|
10995
|
+
};
|
|
10996
|
+
}
|
|
10975
10997
|
if (!canvasDom) {
|
|
10976
10998
|
canvasDom = document.createElement("canvas");
|
|
10977
10999
|
canvasDom.id = "canvas_" + uuid.value;
|
|
@@ -10990,7 +11012,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
10990
11012
|
textBox.style.position = "absolute";
|
|
10991
11013
|
textBox.style.width = "100%";
|
|
10992
11014
|
textBox.style.left = "0";
|
|
10993
|
-
textBox.style.zIndex = "
|
|
11015
|
+
textBox.style.zIndex = "1000";
|
|
10994
11016
|
textBox.style.pointerEvents = "none";
|
|
10995
11017
|
box.appendChild(textBox);
|
|
10996
11018
|
}
|
|
@@ -11001,14 +11023,31 @@ const VideoBoxV2 = defineComponent({
|
|
|
11001
11023
|
height: box.offsetHeight
|
|
11002
11024
|
};
|
|
11003
11025
|
};
|
|
11026
|
+
const clearFlogCanvas = () => {
|
|
11027
|
+
if (canvasDom) {
|
|
11028
|
+
canvasDom.remove();
|
|
11029
|
+
canvasDom = null;
|
|
11030
|
+
}
|
|
11031
|
+
if (textBox) {
|
|
11032
|
+
textBox.remove();
|
|
11033
|
+
textBox = null;
|
|
11034
|
+
}
|
|
11035
|
+
if (drawCleanTimer) {
|
|
11036
|
+
clearTimeout(drawCleanTimer);
|
|
11037
|
+
drawCleanTimer = null;
|
|
11038
|
+
}
|
|
11039
|
+
};
|
|
11004
11040
|
let drawCleanTimer = null;
|
|
11005
|
-
const drawFlog = data => {
|
|
11041
|
+
const drawFlog = async data => {
|
|
11006
11042
|
let {
|
|
11007
11043
|
canvasDom: canvasDom2,
|
|
11008
11044
|
width,
|
|
11009
11045
|
height,
|
|
11010
11046
|
textBox: textBox2
|
|
11011
|
-
} = createFlogCanvas();
|
|
11047
|
+
} = await createFlogCanvas();
|
|
11048
|
+
if (!canvasDom2) {
|
|
11049
|
+
return;
|
|
11050
|
+
}
|
|
11012
11051
|
const ctx = canvasDom2.getContext("2d");
|
|
11013
11052
|
if (drawCleanTimer) {
|
|
11014
11053
|
clearTimeout(drawCleanTimer);
|
|
@@ -11025,12 +11064,12 @@ const VideoBoxV2 = defineComponent({
|
|
|
11025
11064
|
});
|
|
11026
11065
|
}
|
|
11027
11066
|
if (data.text) {
|
|
11028
|
-
const fontSize =
|
|
11067
|
+
const fontSize = 16 * width / 800;
|
|
11029
11068
|
const margin = 10;
|
|
11030
11069
|
const marginTop = height * 0.1 + margin;
|
|
11031
11070
|
textBox2.innerHTML = data.text;
|
|
11032
11071
|
textBox2.style.top = marginTop + "px";
|
|
11033
|
-
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.
|
|
11072
|
+
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.8)";
|
|
11034
11073
|
textBox2.style.color = data.text_color || "red";
|
|
11035
11074
|
textBox2.style.fontSize = `${fontSize}px`;
|
|
11036
11075
|
textBox2.style.padding = `${margin}px`;
|
|
@@ -11050,7 +11089,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
11050
11089
|
const vlmSwitchKey = computed(() => {
|
|
11051
11090
|
return `showVlmInfo_${camera.value?.uuid}`;
|
|
11052
11091
|
});
|
|
11053
|
-
watchEffect(() => {
|
|
11092
|
+
watchEffect(async () => {
|
|
11054
11093
|
if (showVlmInfo.value) {
|
|
11055
11094
|
localStorage.removeItem(vlmSwitchKey.value);
|
|
11056
11095
|
} else {
|
|
@@ -11060,7 +11099,10 @@ const VideoBoxV2 = defineComponent({
|
|
|
11060
11099
|
textBox: textBox2,
|
|
11061
11100
|
width,
|
|
11062
11101
|
height
|
|
11063
|
-
} = createFlogCanvas();
|
|
11102
|
+
} = await createFlogCanvas();
|
|
11103
|
+
if (!canvasDom2) {
|
|
11104
|
+
return;
|
|
11105
|
+
}
|
|
11064
11106
|
const ctx = canvasDom2.getContext("2d");
|
|
11065
11107
|
clearTimeout(drawCleanTimer);
|
|
11066
11108
|
removeTxtBox();
|
|
@@ -11069,7 +11111,8 @@ const VideoBoxV2 = defineComponent({
|
|
|
11069
11111
|
});
|
|
11070
11112
|
return () => createVNode("div", {
|
|
11071
11113
|
"id": "videoBox_" + uuid.value,
|
|
11072
|
-
"class": ["videoBox", _prop.alarm ? "alarm" : ""]
|
|
11114
|
+
"class": ["videoBox", _prop.alarm ? "alarm" : ""],
|
|
11115
|
+
"ref": videoBoxRef
|
|
11073
11116
|
}, [camera.value ? createVNode(VideoPlayerV2, {
|
|
11074
11117
|
"ref": player,
|
|
11075
11118
|
"domId": uuid.value,
|
|
@@ -11112,7 +11155,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
11112
11155
|
}, [createVNode("div", null, [info.name ? `${info.name}\uFF1A` : ""]), createVNode("div", {
|
|
11113
11156
|
"class": "value"
|
|
11114
11157
|
}, [info.displayValue && info.displayValue !== "null" ? info.displayValue + " " : ""]), createVNode("div", null, [info.unit])]);
|
|
11115
|
-
})]) : "", createVNode("div", {
|
|
11158
|
+
})]) : "", withDirectives(createVNode("div", {
|
|
11116
11159
|
"class": "footer-min",
|
|
11117
11160
|
"id": "footer_" + uuid.value
|
|
11118
11161
|
}, [createVNode("div", {
|
|
@@ -11258,7 +11301,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
11258
11301
|
return createVNode("img", {
|
|
11259
11302
|
"onClick": e => {
|
|
11260
11303
|
e.stopPropagation();
|
|
11261
|
-
|
|
11304
|
+
toggle();
|
|
11262
11305
|
},
|
|
11263
11306
|
"src": "/micro-assets/inl/video/putUp.png"
|
|
11264
11307
|
}, null);
|
|
@@ -11271,7 +11314,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
11271
11314
|
}, null);
|
|
11272
11315
|
}
|
|
11273
11316
|
}
|
|
11274
|
-
})])]), renderChangeCamera()]);
|
|
11317
|
+
})])]), [[vShow, !isFullscreen.value]]), renderChangeCamera()]);
|
|
11275
11318
|
}
|
|
11276
11319
|
});
|
|
11277
11320
|
var VideoBoxV2$1 = installComponent(VideoBoxV2, "video-box-v2");
|
package/dist/video/index.cjs
CHANGED
|
@@ -6742,6 +6742,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
6742
6742
|
},
|
|
6743
6743
|
emits: ["close", "change"],
|
|
6744
6744
|
setup(_prop, _context) {
|
|
6745
|
+
const videoBoxRef = vue.ref();
|
|
6745
6746
|
const player = vue.ref();
|
|
6746
6747
|
const cameraConfig = vue.ref({});
|
|
6747
6748
|
const streamHistory = vue.ref("");
|
|
@@ -7033,6 +7034,15 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7033
7034
|
};
|
|
7034
7035
|
let Mqtt = null;
|
|
7035
7036
|
const topic = vue.ref("");
|
|
7037
|
+
const {
|
|
7038
|
+
isFullscreen,
|
|
7039
|
+
enter,
|
|
7040
|
+
exit,
|
|
7041
|
+
toggle
|
|
7042
|
+
} = core.useFullscreen(videoBoxRef);
|
|
7043
|
+
vue.watch(() => isFullscreen.value, val => {
|
|
7044
|
+
clearFlogCanvas();
|
|
7045
|
+
});
|
|
7036
7046
|
const initMqtt = async ip => {
|
|
7037
7047
|
Mqtt = await useMqtt();
|
|
7038
7048
|
topic.value = `vlm/${ip}`;
|
|
@@ -7047,15 +7057,27 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7047
7057
|
});
|
|
7048
7058
|
Mqtt.on("message", onMtMessageFn);
|
|
7049
7059
|
};
|
|
7050
|
-
const onMtMessageFn = (
|
|
7060
|
+
const onMtMessageFn = (topicStr, message2) => {
|
|
7061
|
+
if (topicStr !== topic.value) {
|
|
7062
|
+
return;
|
|
7063
|
+
}
|
|
7051
7064
|
const msg = new TextDecoder("utf-8").decode(message2);
|
|
7052
7065
|
console.log("msg", JSON.parse(msg));
|
|
7053
7066
|
drawFlog(JSON.parse(msg));
|
|
7054
7067
|
};
|
|
7055
7068
|
let canvasDom = null;
|
|
7056
7069
|
let textBox = null;
|
|
7057
|
-
const createFlogCanvas = () => {
|
|
7070
|
+
const createFlogCanvas = async () => {
|
|
7071
|
+
await vue.nextTick();
|
|
7058
7072
|
const box = document.getElementById("videoBox_" + uuid.value);
|
|
7073
|
+
if (!box) {
|
|
7074
|
+
return {
|
|
7075
|
+
canvas: null,
|
|
7076
|
+
textBox: null,
|
|
7077
|
+
width: 0,
|
|
7078
|
+
height: 0
|
|
7079
|
+
};
|
|
7080
|
+
}
|
|
7059
7081
|
if (!canvasDom) {
|
|
7060
7082
|
canvasDom = document.createElement("canvas");
|
|
7061
7083
|
canvasDom.id = "canvas_" + uuid.value;
|
|
@@ -7074,7 +7096,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7074
7096
|
textBox.style.position = "absolute";
|
|
7075
7097
|
textBox.style.width = "100%";
|
|
7076
7098
|
textBox.style.left = "0";
|
|
7077
|
-
textBox.style.zIndex = "
|
|
7099
|
+
textBox.style.zIndex = "1000";
|
|
7078
7100
|
textBox.style.pointerEvents = "none";
|
|
7079
7101
|
box.appendChild(textBox);
|
|
7080
7102
|
}
|
|
@@ -7085,14 +7107,31 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7085
7107
|
height: box.offsetHeight
|
|
7086
7108
|
};
|
|
7087
7109
|
};
|
|
7110
|
+
const clearFlogCanvas = () => {
|
|
7111
|
+
if (canvasDom) {
|
|
7112
|
+
canvasDom.remove();
|
|
7113
|
+
canvasDom = null;
|
|
7114
|
+
}
|
|
7115
|
+
if (textBox) {
|
|
7116
|
+
textBox.remove();
|
|
7117
|
+
textBox = null;
|
|
7118
|
+
}
|
|
7119
|
+
if (drawCleanTimer) {
|
|
7120
|
+
clearTimeout(drawCleanTimer);
|
|
7121
|
+
drawCleanTimer = null;
|
|
7122
|
+
}
|
|
7123
|
+
};
|
|
7088
7124
|
let drawCleanTimer = null;
|
|
7089
|
-
const drawFlog = data => {
|
|
7125
|
+
const drawFlog = async data => {
|
|
7090
7126
|
let {
|
|
7091
7127
|
canvasDom: canvasDom2,
|
|
7092
7128
|
width,
|
|
7093
7129
|
height,
|
|
7094
7130
|
textBox: textBox2
|
|
7095
|
-
} = createFlogCanvas();
|
|
7131
|
+
} = await createFlogCanvas();
|
|
7132
|
+
if (!canvasDom2) {
|
|
7133
|
+
return;
|
|
7134
|
+
}
|
|
7096
7135
|
const ctx = canvasDom2.getContext("2d");
|
|
7097
7136
|
if (drawCleanTimer) {
|
|
7098
7137
|
clearTimeout(drawCleanTimer);
|
|
@@ -7109,12 +7148,12 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7109
7148
|
});
|
|
7110
7149
|
}
|
|
7111
7150
|
if (data.text) {
|
|
7112
|
-
const fontSize =
|
|
7151
|
+
const fontSize = 16 * width / 800;
|
|
7113
7152
|
const margin = 10;
|
|
7114
7153
|
const marginTop = height * 0.1 + margin;
|
|
7115
7154
|
textBox2.innerHTML = data.text;
|
|
7116
7155
|
textBox2.style.top = marginTop + "px";
|
|
7117
|
-
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.
|
|
7156
|
+
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.8)";
|
|
7118
7157
|
textBox2.style.color = data.text_color || "red";
|
|
7119
7158
|
textBox2.style.fontSize = `${fontSize}px`;
|
|
7120
7159
|
textBox2.style.padding = `${margin}px`;
|
|
@@ -7134,7 +7173,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7134
7173
|
const vlmSwitchKey = vue.computed(() => {
|
|
7135
7174
|
return `showVlmInfo_${camera.value?.uuid}`;
|
|
7136
7175
|
});
|
|
7137
|
-
vue.watchEffect(() => {
|
|
7176
|
+
vue.watchEffect(async () => {
|
|
7138
7177
|
if (showVlmInfo.value) {
|
|
7139
7178
|
localStorage.removeItem(vlmSwitchKey.value);
|
|
7140
7179
|
} else {
|
|
@@ -7144,7 +7183,10 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7144
7183
|
textBox: textBox2,
|
|
7145
7184
|
width,
|
|
7146
7185
|
height
|
|
7147
|
-
} = createFlogCanvas();
|
|
7186
|
+
} = await createFlogCanvas();
|
|
7187
|
+
if (!canvasDom2) {
|
|
7188
|
+
return;
|
|
7189
|
+
}
|
|
7148
7190
|
const ctx = canvasDom2.getContext("2d");
|
|
7149
7191
|
clearTimeout(drawCleanTimer);
|
|
7150
7192
|
removeTxtBox();
|
|
@@ -7153,7 +7195,8 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7153
7195
|
});
|
|
7154
7196
|
return () => vue.createVNode("div", {
|
|
7155
7197
|
"id": "videoBox_" + uuid.value,
|
|
7156
|
-
"class": ["videoBox", _prop.alarm ? "alarm" : ""]
|
|
7198
|
+
"class": ["videoBox", _prop.alarm ? "alarm" : ""],
|
|
7199
|
+
"ref": videoBoxRef
|
|
7157
7200
|
}, [camera.value ? vue.createVNode(VideoPlayerV2, {
|
|
7158
7201
|
"ref": player,
|
|
7159
7202
|
"domId": uuid.value,
|
|
@@ -7196,7 +7239,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7196
7239
|
}, [vue.createVNode("div", null, [info.name ? `${info.name}\uFF1A` : ""]), vue.createVNode("div", {
|
|
7197
7240
|
"class": "value"
|
|
7198
7241
|
}, [info.displayValue && info.displayValue !== "null" ? info.displayValue + " " : ""]), vue.createVNode("div", null, [info.unit])]);
|
|
7199
|
-
})]) : "", vue.createVNode("div", {
|
|
7242
|
+
})]) : "", vue.withDirectives(vue.createVNode("div", {
|
|
7200
7243
|
"class": "footer-min",
|
|
7201
7244
|
"id": "footer_" + uuid.value
|
|
7202
7245
|
}, [vue.createVNode("div", {
|
|
@@ -7342,7 +7385,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7342
7385
|
return vue.createVNode("img", {
|
|
7343
7386
|
"onClick": e => {
|
|
7344
7387
|
e.stopPropagation();
|
|
7345
|
-
|
|
7388
|
+
toggle();
|
|
7346
7389
|
},
|
|
7347
7390
|
"src": "/micro-assets/inl/video/putUp.png"
|
|
7348
7391
|
}, null);
|
|
@@ -7355,7 +7398,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
7355
7398
|
}, null);
|
|
7356
7399
|
}
|
|
7357
7400
|
}
|
|
7358
|
-
})])]), renderChangeCamera()]);
|
|
7401
|
+
})])]), [[vue.vShow, !isFullscreen.value]]), renderChangeCamera()]);
|
|
7359
7402
|
}
|
|
7360
7403
|
});
|
|
7361
7404
|
var VideoBoxV2$1 = installComponent(VideoBoxV2, "video-box-v2");
|
package/dist/video/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref, defineComponent, reactive, watchEffect, watch, onBeforeUnmount, createVNode, Fragment, toRefs, resolveComponent, onMounted, withDirectives, vShow, isVNode, computed, shallowRef, onBeforeMount
|
|
1
|
+
import { ref, defineComponent, reactive, watchEffect, watch, onBeforeUnmount, createVNode, Fragment, toRefs, resolveComponent, onMounted, withDirectives, vShow, isVNode, computed, nextTick, shallowRef, onBeforeMount } from 'vue';
|
|
2
2
|
import { SearchOutlined, FullscreenOutlined, createFromIconfontCN } from '@ant-design/icons-vue';
|
|
3
3
|
import axios$2 from 'axios';
|
|
4
|
-
import { resolveRef } from '@vueuse/core';
|
|
4
|
+
import { resolveRef, useFullscreen } from '@vueuse/core';
|
|
5
5
|
import { cloneDeep } from 'lodash';
|
|
6
6
|
import mqtt from 'mqtt';
|
|
7
7
|
import { useRouter } from 'vue-router';
|
|
@@ -6715,6 +6715,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
6715
6715
|
},
|
|
6716
6716
|
emits: ["close", "change"],
|
|
6717
6717
|
setup(_prop, _context) {
|
|
6718
|
+
const videoBoxRef = ref();
|
|
6718
6719
|
const player = ref();
|
|
6719
6720
|
const cameraConfig = ref({});
|
|
6720
6721
|
const streamHistory = ref("");
|
|
@@ -7006,6 +7007,15 @@ const VideoBoxV2 = defineComponent({
|
|
|
7006
7007
|
};
|
|
7007
7008
|
let Mqtt = null;
|
|
7008
7009
|
const topic = ref("");
|
|
7010
|
+
const {
|
|
7011
|
+
isFullscreen,
|
|
7012
|
+
enter,
|
|
7013
|
+
exit,
|
|
7014
|
+
toggle
|
|
7015
|
+
} = useFullscreen(videoBoxRef);
|
|
7016
|
+
watch(() => isFullscreen.value, val => {
|
|
7017
|
+
clearFlogCanvas();
|
|
7018
|
+
});
|
|
7009
7019
|
const initMqtt = async ip => {
|
|
7010
7020
|
Mqtt = await useMqtt();
|
|
7011
7021
|
topic.value = `vlm/${ip}`;
|
|
@@ -7020,15 +7030,27 @@ const VideoBoxV2 = defineComponent({
|
|
|
7020
7030
|
});
|
|
7021
7031
|
Mqtt.on("message", onMtMessageFn);
|
|
7022
7032
|
};
|
|
7023
|
-
const onMtMessageFn = (
|
|
7033
|
+
const onMtMessageFn = (topicStr, message2) => {
|
|
7034
|
+
if (topicStr !== topic.value) {
|
|
7035
|
+
return;
|
|
7036
|
+
}
|
|
7024
7037
|
const msg = new TextDecoder("utf-8").decode(message2);
|
|
7025
7038
|
console.log("msg", JSON.parse(msg));
|
|
7026
7039
|
drawFlog(JSON.parse(msg));
|
|
7027
7040
|
};
|
|
7028
7041
|
let canvasDom = null;
|
|
7029
7042
|
let textBox = null;
|
|
7030
|
-
const createFlogCanvas = () => {
|
|
7043
|
+
const createFlogCanvas = async () => {
|
|
7044
|
+
await nextTick();
|
|
7031
7045
|
const box = document.getElementById("videoBox_" + uuid.value);
|
|
7046
|
+
if (!box) {
|
|
7047
|
+
return {
|
|
7048
|
+
canvas: null,
|
|
7049
|
+
textBox: null,
|
|
7050
|
+
width: 0,
|
|
7051
|
+
height: 0
|
|
7052
|
+
};
|
|
7053
|
+
}
|
|
7032
7054
|
if (!canvasDom) {
|
|
7033
7055
|
canvasDom = document.createElement("canvas");
|
|
7034
7056
|
canvasDom.id = "canvas_" + uuid.value;
|
|
@@ -7047,7 +7069,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
7047
7069
|
textBox.style.position = "absolute";
|
|
7048
7070
|
textBox.style.width = "100%";
|
|
7049
7071
|
textBox.style.left = "0";
|
|
7050
|
-
textBox.style.zIndex = "
|
|
7072
|
+
textBox.style.zIndex = "1000";
|
|
7051
7073
|
textBox.style.pointerEvents = "none";
|
|
7052
7074
|
box.appendChild(textBox);
|
|
7053
7075
|
}
|
|
@@ -7058,14 +7080,31 @@ const VideoBoxV2 = defineComponent({
|
|
|
7058
7080
|
height: box.offsetHeight
|
|
7059
7081
|
};
|
|
7060
7082
|
};
|
|
7083
|
+
const clearFlogCanvas = () => {
|
|
7084
|
+
if (canvasDom) {
|
|
7085
|
+
canvasDom.remove();
|
|
7086
|
+
canvasDom = null;
|
|
7087
|
+
}
|
|
7088
|
+
if (textBox) {
|
|
7089
|
+
textBox.remove();
|
|
7090
|
+
textBox = null;
|
|
7091
|
+
}
|
|
7092
|
+
if (drawCleanTimer) {
|
|
7093
|
+
clearTimeout(drawCleanTimer);
|
|
7094
|
+
drawCleanTimer = null;
|
|
7095
|
+
}
|
|
7096
|
+
};
|
|
7061
7097
|
let drawCleanTimer = null;
|
|
7062
|
-
const drawFlog = data => {
|
|
7098
|
+
const drawFlog = async data => {
|
|
7063
7099
|
let {
|
|
7064
7100
|
canvasDom: canvasDom2,
|
|
7065
7101
|
width,
|
|
7066
7102
|
height,
|
|
7067
7103
|
textBox: textBox2
|
|
7068
|
-
} = createFlogCanvas();
|
|
7104
|
+
} = await createFlogCanvas();
|
|
7105
|
+
if (!canvasDom2) {
|
|
7106
|
+
return;
|
|
7107
|
+
}
|
|
7069
7108
|
const ctx = canvasDom2.getContext("2d");
|
|
7070
7109
|
if (drawCleanTimer) {
|
|
7071
7110
|
clearTimeout(drawCleanTimer);
|
|
@@ -7082,12 +7121,12 @@ const VideoBoxV2 = defineComponent({
|
|
|
7082
7121
|
});
|
|
7083
7122
|
}
|
|
7084
7123
|
if (data.text) {
|
|
7085
|
-
const fontSize =
|
|
7124
|
+
const fontSize = 16 * width / 800;
|
|
7086
7125
|
const margin = 10;
|
|
7087
7126
|
const marginTop = height * 0.1 + margin;
|
|
7088
7127
|
textBox2.innerHTML = data.text;
|
|
7089
7128
|
textBox2.style.top = marginTop + "px";
|
|
7090
|
-
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.
|
|
7129
|
+
textBox2.style.backgroundColor = "rgba(255, 255, 255, 0.8)";
|
|
7091
7130
|
textBox2.style.color = data.text_color || "red";
|
|
7092
7131
|
textBox2.style.fontSize = `${fontSize}px`;
|
|
7093
7132
|
textBox2.style.padding = `${margin}px`;
|
|
@@ -7107,7 +7146,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
7107
7146
|
const vlmSwitchKey = computed(() => {
|
|
7108
7147
|
return `showVlmInfo_${camera.value?.uuid}`;
|
|
7109
7148
|
});
|
|
7110
|
-
watchEffect(() => {
|
|
7149
|
+
watchEffect(async () => {
|
|
7111
7150
|
if (showVlmInfo.value) {
|
|
7112
7151
|
localStorage.removeItem(vlmSwitchKey.value);
|
|
7113
7152
|
} else {
|
|
@@ -7117,7 +7156,10 @@ const VideoBoxV2 = defineComponent({
|
|
|
7117
7156
|
textBox: textBox2,
|
|
7118
7157
|
width,
|
|
7119
7158
|
height
|
|
7120
|
-
} = createFlogCanvas();
|
|
7159
|
+
} = await createFlogCanvas();
|
|
7160
|
+
if (!canvasDom2) {
|
|
7161
|
+
return;
|
|
7162
|
+
}
|
|
7121
7163
|
const ctx = canvasDom2.getContext("2d");
|
|
7122
7164
|
clearTimeout(drawCleanTimer);
|
|
7123
7165
|
removeTxtBox();
|
|
@@ -7126,7 +7168,8 @@ const VideoBoxV2 = defineComponent({
|
|
|
7126
7168
|
});
|
|
7127
7169
|
return () => createVNode("div", {
|
|
7128
7170
|
"id": "videoBox_" + uuid.value,
|
|
7129
|
-
"class": ["videoBox", _prop.alarm ? "alarm" : ""]
|
|
7171
|
+
"class": ["videoBox", _prop.alarm ? "alarm" : ""],
|
|
7172
|
+
"ref": videoBoxRef
|
|
7130
7173
|
}, [camera.value ? createVNode(VideoPlayerV2, {
|
|
7131
7174
|
"ref": player,
|
|
7132
7175
|
"domId": uuid.value,
|
|
@@ -7169,7 +7212,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
7169
7212
|
}, [createVNode("div", null, [info.name ? `${info.name}\uFF1A` : ""]), createVNode("div", {
|
|
7170
7213
|
"class": "value"
|
|
7171
7214
|
}, [info.displayValue && info.displayValue !== "null" ? info.displayValue + " " : ""]), createVNode("div", null, [info.unit])]);
|
|
7172
|
-
})]) : "", createVNode("div", {
|
|
7215
|
+
})]) : "", withDirectives(createVNode("div", {
|
|
7173
7216
|
"class": "footer-min",
|
|
7174
7217
|
"id": "footer_" + uuid.value
|
|
7175
7218
|
}, [createVNode("div", {
|
|
@@ -7315,7 +7358,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
7315
7358
|
return createVNode("img", {
|
|
7316
7359
|
"onClick": e => {
|
|
7317
7360
|
e.stopPropagation();
|
|
7318
|
-
|
|
7361
|
+
toggle();
|
|
7319
7362
|
},
|
|
7320
7363
|
"src": "/micro-assets/inl/video/putUp.png"
|
|
7321
7364
|
}, null);
|
|
@@ -7328,7 +7371,7 @@ const VideoBoxV2 = defineComponent({
|
|
|
7328
7371
|
}, null);
|
|
7329
7372
|
}
|
|
7330
7373
|
}
|
|
7331
|
-
})])]), renderChangeCamera()]);
|
|
7374
|
+
})])]), [[vShow, !isFullscreen.value]]), renderChangeCamera()]);
|
|
7332
7375
|
}
|
|
7333
7376
|
});
|
|
7334
7377
|
var VideoBoxV2$1 = installComponent(VideoBoxV2, "video-box-v2");
|