类型:开发
描述:
This commit is contained in:
@@ -287,7 +287,12 @@
|
||||
// 返回列表
|
||||
const handleBack = () => {
|
||||
videoLog.value = 1
|
||||
hlsRef.destroy()
|
||||
try{
|
||||
hlsRef.destroy()
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
|
||||
initVideo()
|
||||
}
|
||||
let isCollect = ref(0)
|
||||
@@ -308,7 +313,12 @@
|
||||
const clearHlsRefs = () => {
|
||||
if (hlsRefs.length > 0) {
|
||||
hlsRefs.map((item) => {
|
||||
item.destroy()
|
||||
try{
|
||||
item.destroy()
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
hlsRefs = []
|
||||
}
|
||||
@@ -337,8 +347,13 @@
|
||||
player.play()
|
||||
// 错误处理和重连机制
|
||||
player.on(mpegtsjs.Events.ERROR, (err) => {
|
||||
player.unload();
|
||||
player.destroy();
|
||||
try{
|
||||
player.unload();
|
||||
player.destroy();
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
|
||||
console.error('播放器错误:', err)
|
||||
// 3 秒后尝试重新加载
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user