diff --git a/src/view/dialog/dialogCamera.vue b/src/view/dialog/dialogCamera.vue
index 5f9b02c..bb1c945 100644
--- a/src/view/dialog/dialogCamera.vue
+++ b/src/view/dialog/dialogCamera.vue
@@ -39,6 +39,7 @@
props.cameraShow,
(newVal, oldVal) => {
- cameraShow.value = newVal;
- attachmentLink.value=props.hlsUriSsl;
- nextTick(() => {
- loadVideo();
- });
+ if (newVal) {
+ if (hlsUriSslNow.value == "") {
+ num.value = false;
+ } else {
+ num.value = true;
+ }
+ // if (hlsUriSslNow.value != "" && props.hlsUriSsl != hlsUriSslNow.value)
+ cameraShow.value = newVal;
+ hlsUriSslNow.value = props.hlsUriSsl;
+ attachmentLink.value = hlsUriSslNow.value;
+ dp.value = null;
+ //当摄像头第二次打开时,要先创建dom
+ if (num.value) {
+ console.log(22222, document.getElementById("videoBox"));
+ insertVideo();
+ }
+ nextTick(() => {
+ loadVideo();
+ });
+ }
}
);
-
+const insertVideo = () => {
+ const videoElement = document.createElement("video");
+ videoElement.id = "videoPlayer";
+ videoElement.className = "video-js vjs-default-skin";
+ videoElement.controls = true;
+ videoElement.crossOrigin = "anonymous";
+ videoElement.playsinline = true;
+ videoElement.autoplay = true;
+ const sourceElement = document.createElement("source");
+ sourceElement.src = attachmentLink.value;
+ sourceElement.type = "application/x-mpegURL";
+ videoElement.appendChild(sourceElement);
+ document.getElementById("videoBox").appendChild(videoElement);
+};
const dp = ref(null);
-const videoElement = ref(null);
-const attachmentLink = ref(
- ""
-);
+const videohtml = ref("");
+const attachmentLink = ref("");
const options = {
playbackRates: [0.5, 1.0, 1.5, 2.0],
aspectRatio: "10:5",
@@ -129,6 +157,8 @@ const closeDialog = () => {
cameraShow.value = false;
if (dp.value) {
dp.value.dispose(); // dispose()会直接删除Dom元素
+ // dp.value.pause();
+ dp.value = null;
}
emit("close");
};
diff --git a/src/view/person/index.vue b/src/view/person/index.vue
index 860919f..2441218 100644
--- a/src/view/person/index.vue
+++ b/src/view/person/index.vue
@@ -103,7 +103,7 @@
返回
-