类型:开发

描述:
This commit is contained in:
2025-12-19 20:16:43 +08:00
parent aa18dc7a4c
commit c392ce026d
4 changed files with 61 additions and 15 deletions

View File

@@ -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(() => {