fix empty transcode segments, widen device profile

This commit is contained in:
2026-05-25 10:06:35 +03:00
parent e681bed1a4
commit 4d20cf9d43
2 changed files with 24 additions and 4 deletions
+20 -2
View File
@@ -1091,10 +1091,28 @@ export default function PlayerPage() {
hls.startLoad()
break
case HLS.ErrorTypes.MEDIA_ERROR:
hls.recoverMediaError()
// fragParsingError ("Found no media") means the
// transcoder returned an empty segment - usually a
// cold-start race. Give it a second and retry from
// the current position before doing the heavy
// recoverMediaError reset (which causes a visible skip).
if (data.details === 'fragParsingError') {
const pos = hls.media?.currentTime
setTimeout(() => {
if (hls.destroyed) return
try {
hls.loadSource(hls.url)
if (pos != null && hls.media) {
hls.media.currentTime = pos
}
hls.startLoad()
} catch { hls.recoverMediaError() }
}, 1000)
} else {
hls.recoverMediaError()
}
break
default:
// Unrecoverable - destroy and let the user retry
hls.destroy()
break
}