类型:开发

描述:
This commit is contained in:
2026-02-04 17:26:47 +08:00
parent 6fe84fe853
commit 87c115ab99

View File

@@ -1,25 +1,6 @@
<template>
<div class="video-box">
<div class="left-nav">
<div v-if="showNav" class="ul">
<div
class="li"
:class="{ active: current == index }"
v-for="(item, index) in navList"
:key="index"
@click="handleNav(index)"
>
<span v-if="!params.businessScenicArea && index == 0"> 核心路段 </span>
<span v-else>
{{ item.dictLabel }}
</span>
</div>
<div
:class="{ active: current == 3 }"
@click="handleNav(3)" class="li">
<span>自定义</span>
</div>
</div>
<div class="bom-box">
<Title2 title="检索" />
<div class="search-box">
@@ -77,14 +58,15 @@
>关注
</div>
<video
class="video-item__video"
:id="'hotelmonitorVideo' + index"
preload="auto"
class="video-item__video"
muted
autoplay
:controls="false"
>
<source type="application/x-mpegURL" />
<source type="application/x-mpegURL"/>
</video>
<p class="video-item__title--primary">
{{ item.cameraName || item.cameraIndexCode }}
@@ -342,9 +324,10 @@
getPreviewUrlApi({
type: 'hls',
cameraIndexCode: cameraIndexCode,
subStream:1
subStream:0
}).then(res=>{
const url = res.data.url;
console.log('url',url)
if(url.startsWith('http://192.168.77.200:8050/')){
const player = new WebRTCWhep({
url:url, // WHEP 服务器地址
@@ -358,6 +341,7 @@
}
})
player.on('play:failed', (err) => {
console.error('错误:',err)
// createPlayer(cameraIndexCode,videoElement);
})
webrtcRefs.push(player)
@@ -438,6 +422,7 @@
cameraIndexCode.value = code
setTimeout(() => {
if (url.startsWith('http://192.168.77.200:8050/')) {
console.error(1111111111)
if(hlsRef){
hlsRef.updateUrl(url);
}else{
@@ -454,6 +439,7 @@
}
})
hlsRef.on('play:failed', (err) => {
console.log('播放失败,尝试重新加载');
// handleItemVideo(url, type, code, item);
})
} else {