类型:开发
描述:
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 @@
|
|||||||
this.initializePlayer();
|
this.initializePlayer();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.hls.on('play:failed', (err) => {
|
||||||
|
this.initializePlayer();
|
||||||
|
})
|
||||||
}else{
|
}else{
|
||||||
this.hls = new Hls({
|
this.hls = new Hls({
|
||||||
// 内存优化配置
|
// 内存优化配置
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ import {getVideoListApi, getColletListApi, getPreviewUrlApi} from '@/api/home'
|
|||||||
console.log(item, 'iscollect')
|
console.log(item, 'iscollect')
|
||||||
let res = await getPreviewUrlApi({
|
let res = await getPreviewUrlApi({
|
||||||
cameraIndexCode: item.cameraIndexCode,
|
cameraIndexCode: item.cameraIndexCode,
|
||||||
type: 'hls'
|
type: 'hls',
|
||||||
|
subStream:0
|
||||||
})
|
})
|
||||||
src.value = res.data.url
|
src.value = res.data.url
|
||||||
isCollect.value = item.isCollect
|
isCollect.value = item.isCollect
|
||||||
@@ -125,7 +126,8 @@ import {getVideoListApi, getColletListApi, getPreviewUrlApi} from '@/api/home'
|
|||||||
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/')){
|
||||||
@@ -140,6 +142,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{
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ let isCollect = ref(0)
|
|||||||
const handleItem = async (item) => {
|
const handleItem = async (item) => {
|
||||||
let res = await getPreviewUrlApi({
|
let res = await getPreviewUrlApi({
|
||||||
cameraIndexCode: item.cameraIndexCode,
|
cameraIndexCode: item.cameraIndexCode,
|
||||||
type: 'hls'
|
type: 'hls',
|
||||||
|
subStream:0
|
||||||
})
|
})
|
||||||
src.value = res.data.url
|
src.value = res.data.url
|
||||||
cameraIndexCode.value = item.cameraIndexCode
|
cameraIndexCode.value = item.cameraIndexCode
|
||||||
@@ -87,7 +88,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
|
||||||
@@ -95,7 +97,8 @@ let isCollect = ref(0)
|
|||||||
const createPlayer = (cameraIndexCode,videoElement) => {
|
const createPlayer = (cameraIndexCode,videoElement) => {
|
||||||
getPreviewUrlApi({
|
getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode: cameraIndexCode
|
cameraIndexCode: cameraIndexCode,
|
||||||
|
subStream:0
|
||||||
}).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/')){
|
||||||
@@ -105,11 +108,13 @@ let isCollect = ref(0)
|
|||||||
iceServers: [{ urls: 'turn:192.168.77.200:3478',username: 'ZLMediaKit',credential: 'ZLMediaKit'}]
|
iceServers: [{ urls: 'turn:192.168.77.200:3478',username: 'ZLMediaKit',credential: 'ZLMediaKit'}]
|
||||||
})
|
})
|
||||||
player.on('error', (error) => {
|
player.on('error', (error) => {
|
||||||
console.error('错误:', error.message, error.type)
|
|
||||||
if(error.type ==='REQUEST_ERROR' || error.type ==='NOT_FOUND_ERROR'){
|
if(error.type ==='REQUEST_ERROR' || error.type ==='NOT_FOUND_ERROR'){
|
||||||
createPlayer(cameraIndexCode,videoElement);
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
player.on('play:failed', (err) => {
|
||||||
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
|
})
|
||||||
webrtcRefs.push(player)
|
webrtcRefs.push(player)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@@ -224,7 +224,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
|
||||||
@@ -283,7 +284,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/')){
|
||||||
@@ -298,6 +300,9 @@
|
|||||||
createPlayer(cameraIndexCode,videoElement);
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
player.on('play:failed', (err) => {
|
||||||
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
|
})
|
||||||
webrtcRefs.push(player)
|
webrtcRefs.push(player)
|
||||||
}else{
|
}else{
|
||||||
const player = new Hls({
|
const player = new Hls({
|
||||||
|
|||||||
@@ -304,7 +304,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
|
||||||
@@ -340,7 +341,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/')){
|
||||||
@@ -355,6 +357,9 @@
|
|||||||
createPlayer(cameraIndexCode,videoElement);
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
player.on('play:failed', (err) => {
|
||||||
|
createPlayer(cameraIndexCode,videoElement);
|
||||||
|
})
|
||||||
webrtcRefs.push(player)
|
webrtcRefs.push(player)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -424,7 +429,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
|
||||||
@@ -447,6 +453,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, // 最大缓冲长度(秒)
|
||||||
|
|||||||
@@ -261,7 +261,8 @@
|
|||||||
window.addEventListener("message", async(e) => {
|
window.addEventListener("message", async(e) => {
|
||||||
let {code,data} = await getPreviewUrlApi({
|
let {code,data} = await getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode:e.data.cameraIndexCode
|
cameraIndexCode:e.data.cameraIndexCode,
|
||||||
|
subStream:0
|
||||||
})
|
})
|
||||||
if(code===200){
|
if(code===200){
|
||||||
src.value = data.url
|
src.value = data.url
|
||||||
|
|||||||
@@ -366,7 +366,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
|
||||||
@@ -438,7 +439,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
|
||||||
@@ -501,7 +503,8 @@ watch(
|
|||||||
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/')){
|
||||||
|
|||||||
@@ -174,7 +174,8 @@ import pubSub from 'pubsub-js'
|
|||||||
window.addEventListener("message", async(e) => {
|
window.addEventListener("message", async(e) => {
|
||||||
let {code,data} = await getPreviewUrlApi({
|
let {code,data} = await getPreviewUrlApi({
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
cameraIndexCode:e.data.cameraIndexCode
|
cameraIndexCode:e.data.cameraIndexCode,
|
||||||
|
subStream:0
|
||||||
})
|
})
|
||||||
if(code===200){
|
if(code===200){
|
||||||
src.value = data.url
|
src.value = data.url
|
||||||
|
|||||||
@@ -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