From 8a507bb6e4a75fd402c07c64af663cb79dfa68b1 Mon Sep 17 00:00:00 2001 From: wwp <782568523@qq.com> Date: Wed, 9 Oct 2024 15:46:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/monitor/live/index.vue | 28 +- .../src/views/monitor/live/index1.vue | 600 ++++++++++++++++++ 2 files changed, 620 insertions(+), 8 deletions(-) create mode 100644 SafeCampus.WEB/src/views/monitor/live/index1.vue diff --git a/SafeCampus.WEB/src/views/monitor/live/index.vue b/SafeCampus.WEB/src/views/monitor/live/index.vue index 19c14d6..a442cd2 100644 --- a/SafeCampus.WEB/src/views/monitor/live/index.vue +++ b/SafeCampus.WEB/src/views/monitor/live/index.vue @@ -107,12 +107,12 @@
-
+
@@ -436,7 +436,7 @@ function onDetail(row: any) { visible.value = true; detailData.sensorId = row.sensorId; detailData.title = row.sensorName + "(" + row.sensorId + ")"; - getUrl(); + getUrl(row.sensorId); } // 刷新 const showVideo = ref(false); @@ -449,7 +449,8 @@ function refreshUrl() { }, 1000); } let num = 1; -function getUrl() { + +function getUrl(sensorId:any) { detailData.videoType = "m3u8"; setTimeout(async () => { await monitorLIVEApi.detail({ sensorId: detailData.sensorId }).then((res:any) => { @@ -463,7 +464,18 @@ function getUrl() { detailData.streamId = data.streamId; detailData.videoToken = data.videoToken; // getvideo1() - getvideo2(); + let localurl = '' + if(sensorId == 'SXT001') { + localurl = 'http://123.57.209.16:8004/video/1.mp4' + getvideo2(localurl); + } else if(sensorId == 'SXT002'){ + localurl = 'http://123.57.209.16:8004/video/5.mp4' + getvideo2(localurl); + } else if(sensorId == 'SXT003') { + localurl = 'http://123.57.209.16:8004/video/2.mp4' + getvideo2(localurl); + } + } }); }); @@ -500,10 +512,10 @@ function getvideo1() { // aliRts.startLiveStream(pullStreamUrl, mediaEle); } let player = ref(null); -function getvideo2() { +function getvideo2(url:any) { var options = { id: "player-con", - source: detailData.videoUrl + "&subaudio=no&jitterbuffer=6000", + source: url, // "rtsFallbackSource": "降级地址,如HLS", width: "100%", height: "500px", @@ -549,7 +561,7 @@ const handleClose = () => { visible.value = false; detailData.videoUrl = ""; detailData.videoType = ""; - stopUrl(); + // stopUrl(); if (player.value) { player.value.dispose(); } diff --git a/SafeCampus.WEB/src/views/monitor/live/index1.vue b/SafeCampus.WEB/src/views/monitor/live/index1.vue new file mode 100644 index 0000000..19c14d6 --- /dev/null +++ b/SafeCampus.WEB/src/views/monitor/live/index1.vue @@ -0,0 +1,600 @@ + + + + +