类型:开发
描述:
This commit is contained in:
8
package-lock.json
generated
8
package-lock.json
generated
@@ -25,7 +25,7 @@
|
|||||||
"vue-router": "^4.4.5",
|
"vue-router": "^4.4.5",
|
||||||
"vue3-seamless-scroll": "^2.0.1",
|
"vue3-seamless-scroll": "^2.0.1",
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"whepts": "^1.1.11"
|
"whepts": "^1.1.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^5.2.1",
|
"@vitejs/plugin-vue": "^5.2.1",
|
||||||
@@ -6188,9 +6188,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/whepts": {
|
"node_modules/whepts": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.12",
|
||||||
"resolved": "https://registry.npmjs.org/whepts/-/whepts-1.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/whepts/-/whepts-1.1.12.tgz",
|
||||||
"integrity": "sha512-NJ37rUXS4aeO36sxmSTxMZTGXdScedxdhAt7oKhFhzAeV/IjNCWdyu8d+fSGSEAPjJS4FnBzwSFLrENZjAqcRA==",
|
"integrity": "sha512-KllGslriMAhD6BDBbG6X653M8XgeYqxnjuEyaB7U/1nIZN6NoAGSWP3Av46g690r2UaaI69bNzfPn4efJBd+kA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"eventemitter3": "^5.0.4",
|
"eventemitter3": "^5.0.4",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"vue-router": "^4.4.5",
|
"vue-router": "^4.4.5",
|
||||||
"vue3-seamless-scroll": "^2.0.1",
|
"vue3-seamless-scroll": "^2.0.1",
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"whepts": "^1.1.11"
|
"whepts": "^1.1.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^5.2.1",
|
"@vitejs/plugin-vue": "^5.2.1",
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ export default {
|
|||||||
this.initializePlayer();
|
this.initializePlayer();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.hls.on('play:failed', (err) => {
|
||||||
|
this.initializePlayer();
|
||||||
|
})
|
||||||
}else{
|
}else{
|
||||||
this.hls = new Hls({
|
this.hls = new Hls({
|
||||||
// 内存优化配置
|
// 内存优化配置
|
||||||
|
|||||||
@@ -122,7 +122,8 @@
|
|||||||
const createPlayer = (cameraIndexCode,videoElement) => {
|
const createPlayer = (cameraIndexCode,videoElement) => {
|
||||||
getPreviewUrlApi({
|
getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode: cameraIndexCode
|
cameraIndexCode: cameraIndexCode,
|
||||||
|
subStream:1
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
const url = res.data.url;
|
const url = res.data.url;
|
||||||
if(url.startsWith('http://192.168.77.200:8050/')){
|
if(url.startsWith('http://192.168.77.200:8050/')){
|
||||||
@@ -137,6 +138,9 @@
|
|||||||
createPlayer(cameraIndexCode,videoElement);
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
player.on('play:failed', (err) => {
|
||||||
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
|
})
|
||||||
webrtcRefs.push(player)
|
webrtcRefs.push(player)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ let isCollect = ref(0)
|
|||||||
const getPreviewUrl = async (code) => {
|
const getPreviewUrl = async (code) => {
|
||||||
let res = await getPreviewUrlApi({
|
let res = await getPreviewUrlApi({
|
||||||
cameraIndexCode: code,
|
cameraIndexCode: code,
|
||||||
type: 'hls'
|
type: 'hls',
|
||||||
|
subStream:1
|
||||||
})
|
})
|
||||||
src.value = res.data.url
|
src.value = res.data.url
|
||||||
videoShow.value = true
|
videoShow.value = true
|
||||||
|
|||||||
@@ -246,7 +246,8 @@ const handleCamera = async (itemCode,resource,index) => {
|
|||||||
show.value = true
|
show.value = true
|
||||||
let res = await getPreviewUrlApi({
|
let res = await getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode:itemCode
|
cameraIndexCode:itemCode,
|
||||||
|
sub_stream: 0
|
||||||
})
|
})
|
||||||
cameraIndexCode.value = itemCode;
|
cameraIndexCode.value = itemCode;
|
||||||
isCollect.value = resource.isCollect
|
isCollect.value = resource.isCollect
|
||||||
@@ -297,7 +298,8 @@ const handleItemVideo = (url, type, code,item) => {
|
|||||||
const createPlayer = (cameraIndexCode,videoElement) => {
|
const createPlayer = (cameraIndexCode,videoElement) => {
|
||||||
getPreviewUrlApi({
|
getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode: cameraIndexCode
|
cameraIndexCode: cameraIndexCode,
|
||||||
|
subStream:1
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
const url = res.data.url;
|
const url = res.data.url;
|
||||||
if(url.startsWith('http://192.168.77.200:8050/')){
|
if(url.startsWith('http://192.168.77.200:8050/')){
|
||||||
@@ -312,6 +314,9 @@ const createPlayer = (cameraIndexCode,videoElement) => {
|
|||||||
createPlayer(cameraIndexCode,videoElement);
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
player.on('play:failed', (err) => {
|
||||||
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
|
})
|
||||||
webrtcRefs.push(player)
|
webrtcRefs.push(player)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@@ -303,7 +303,8 @@ const handleCamera = async (itemCode,resource) => {
|
|||||||
show.value = true
|
show.value = true
|
||||||
let res = await getPreviewUrlApi({
|
let res = await getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode:itemCode
|
cameraIndexCode:itemCode,
|
||||||
|
subStream:0
|
||||||
})
|
})
|
||||||
cameraIndexCode.value = itemCode;
|
cameraIndexCode.value = itemCode;
|
||||||
isCollect.value = resource.isCollect
|
isCollect.value = resource.isCollect
|
||||||
@@ -339,7 +340,8 @@ const currentChange = (e) => {
|
|||||||
const createPlayer = (cameraIndexCode,videoElement) => {
|
const createPlayer = (cameraIndexCode,videoElement) => {
|
||||||
getPreviewUrlApi({
|
getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode: cameraIndexCode
|
cameraIndexCode: cameraIndexCode,
|
||||||
|
subStream:1
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
const url = res.data.url;
|
const url = res.data.url;
|
||||||
if(url.startsWith('http://192.168.77.200:8050/')){
|
if(url.startsWith('http://192.168.77.200:8050/')){
|
||||||
@@ -354,7 +356,9 @@ const createPlayer = (cameraIndexCode,videoElement) => {
|
|||||||
createPlayer(cameraIndexCode,videoElement);
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
player.on('play:failed', (err) => {
|
||||||
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
|
})
|
||||||
webrtcRefs.push(player)
|
webrtcRefs.push(player)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -424,7 +428,8 @@ let thisVideo = ref(null)
|
|||||||
const handleItemVideo = async (url, type, code, item) => {
|
const handleItemVideo = async (url, type, code, item) => {
|
||||||
let res = await getPreviewUrlApi({
|
let res = await getPreviewUrlApi({
|
||||||
cameraIndexCode: code,
|
cameraIndexCode: code,
|
||||||
type: 'hls'
|
type: 'hls',
|
||||||
|
subStream:0
|
||||||
})
|
})
|
||||||
url = res.data.url
|
url = res.data.url
|
||||||
thisVideo.value = item
|
thisVideo.value = item
|
||||||
@@ -447,6 +452,9 @@ const handleItemVideo = async (url, type, code, item) => {
|
|||||||
handleItemVideo(url, type, code, item);
|
handleItemVideo(url, type, code, item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
hlsRef.on('play:failed', (err) => {
|
||||||
|
handleItemVideo(url, type, code, item);
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
hlsRef = new Hls({
|
hlsRef = new Hls({
|
||||||
maxBufferLength: 10, // 最大缓冲长度(秒)
|
maxBufferLength: 10, // 最大缓冲长度(秒)
|
||||||
|
|||||||
@@ -258,7 +258,8 @@
|
|||||||
const createPlayer = (cameraIndexCode,videoElement) => {
|
const createPlayer = (cameraIndexCode,videoElement) => {
|
||||||
getPreviewUrlApi({
|
getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode: cameraIndexCode
|
cameraIndexCode: cameraIndexCode,
|
||||||
|
subStream:1
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
const url = res.data.url;
|
const url = res.data.url;
|
||||||
if(url.startsWith('http://192.168.77.200:8050/')){
|
if(url.startsWith('http://192.168.77.200:8050/')){
|
||||||
@@ -273,6 +274,9 @@
|
|||||||
createPlayer(cameraIndexCode,videoElement);
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
player.on('play:failed', (err) => {
|
||||||
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
|
})
|
||||||
webrtcRefs.push(player)
|
webrtcRefs.push(player)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -393,7 +397,8 @@
|
|||||||
const handleItemVideo = async (url, type, code, item) => {
|
const handleItemVideo = async (url, type, code, item) => {
|
||||||
let res = await getPreviewUrlApi({
|
let res = await getPreviewUrlApi({
|
||||||
cameraIndexCode: code,
|
cameraIndexCode: code,
|
||||||
type: 'hls'
|
type: 'hls',
|
||||||
|
subStream:0
|
||||||
})
|
})
|
||||||
url = res.data.url
|
url = res.data.url
|
||||||
thisVideo.value = item
|
thisVideo.value = item
|
||||||
@@ -416,6 +421,9 @@
|
|||||||
handleItemVideo(url, type, code, item);
|
handleItemVideo(url, type, code, item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
hlsRef.on('play:failed', (err) => {
|
||||||
|
handleItemVideo(url, type, code, item);
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
hlsRef = new Hls({
|
hlsRef = new Hls({
|
||||||
maxBufferLength: 10, // 最大缓冲长度(秒)
|
maxBufferLength: 10, // 最大缓冲长度(秒)
|
||||||
@@ -463,7 +471,8 @@
|
|||||||
show.value = true
|
show.value = true
|
||||||
let res = await getPreviewUrlApi({
|
let res = await getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode: itemCode
|
cameraIndexCode: itemCode,
|
||||||
|
subStream: 0
|
||||||
})
|
})
|
||||||
cameraIndexCode.value = itemCode;
|
cameraIndexCode.value = itemCode;
|
||||||
isCollect.value = resource.isCollect
|
isCollect.value = resource.isCollect
|
||||||
|
|||||||
@@ -191,7 +191,8 @@
|
|||||||
const getPreviewUrl = async (code) => {
|
const getPreviewUrl = async (code) => {
|
||||||
let res = await getPreviewUrlApi({
|
let res = await getPreviewUrlApi({
|
||||||
cameraIndexCode: code,
|
cameraIndexCode: code,
|
||||||
type: 'hls'
|
type: 'hls',
|
||||||
|
subStream:0
|
||||||
})
|
})
|
||||||
src.value = res.data.url
|
src.value = res.data.url
|
||||||
videoShow.value = true
|
videoShow.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user