类型:开发
描述:
This commit is contained in:
@@ -273,7 +273,6 @@ const postVideoRemain = async () => {
|
||||
// })
|
||||
// }, 2000)
|
||||
}
|
||||
|
||||
const initVideo = () => {
|
||||
clearHlsRefs()
|
||||
nextTick(() => {
|
||||
@@ -284,7 +283,6 @@ const initVideo = () => {
|
||||
})
|
||||
}
|
||||
const onInput = debounce((e) => {
|
||||
|
||||
if (e) {
|
||||
getVideoRegions('search')
|
||||
} else {
|
||||
@@ -370,9 +368,11 @@ const handleItemVideo = async (url, type, code, item) => {
|
||||
console.error('播放器错误:', err)
|
||||
// 3 秒后尝试重新加载
|
||||
hlsRef.unload()
|
||||
hlsRef.destroy()
|
||||
// 3 秒后尝试重新加载
|
||||
setTimeout(() => {
|
||||
hlsRef.load()
|
||||
hlsRef.play()
|
||||
console.error('重新加载【'+cameraIndexCode+'】' )
|
||||
handleItemVideo(url, 101, code, item);
|
||||
}, 3000)
|
||||
})
|
||||
} else {
|
||||
@@ -491,15 +491,19 @@ const createPlayer = (cameraIndexCode,videoElement) => {
|
||||
player.play()
|
||||
// 错误处理和重连机制
|
||||
player.on(mpegtsjs.Events.ERROR, (err) => {
|
||||
console.error('播放器错误【'+cameraIndexCode+'】:', err)
|
||||
player.unload();
|
||||
console.error('播放器错误:', err)
|
||||
player.destroy();
|
||||
// 3 秒后尝试重新加载
|
||||
setTimeout(() => {
|
||||
player.load()
|
||||
player.play()
|
||||
console.error('重新加载【'+cameraIndexCode+'】' )
|
||||
createPlayer(cameraIndexCode,videoElement);
|
||||
}, 3000)
|
||||
})
|
||||
|
||||
})
|
||||
player.on(mpegtsjs.Events.LOADING_COMPLETE, (err) => {
|
||||
console.error('加载完成:', err)
|
||||
})
|
||||
hlsRefs.push(player)
|
||||
}
|
||||
else{
|
||||
|
||||
Reference in New Issue
Block a user