fix empty transcode segments, widen device profile
This commit is contained in:
@@ -88,11 +88,13 @@ export function browserDeviceProfile(audioPassthrough = false) {
|
|||||||
|
|
||||||
DirectPlayProfiles: [
|
DirectPlayProfiles: [
|
||||||
{
|
{
|
||||||
Container: 'mp4,m4v',
|
// MSE / hls.js can remux these on the fly - no need to force a
|
||||||
|
// server-side transcode just because the container isn't mp4.
|
||||||
|
Container: 'mp4,m4v,mkv,avi,mov,wmv,ts,mpeg,mpegts',
|
||||||
Type: 'Video',
|
Type: 'Video',
|
||||||
VideoCodec: videoCodecsCsv,
|
VideoCodec: videoCodecsCsv,
|
||||||
AudioCodec: audioPassthrough
|
AudioCodec: audioPassthrough
|
||||||
? 'aac,mp3,ac3,eac3,flac,opus,truehd,dts'
|
? 'aac,mp3,ac3,eac3,flac,opus,truehd,dts,alac,wmapro'
|
||||||
: 'aac,mp3,ac3,eac3,flac,opus',
|
: 'aac,mp3,ac3,eac3,flac,opus',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1091,10 +1091,28 @@ export default function PlayerPage() {
|
|||||||
hls.startLoad()
|
hls.startLoad()
|
||||||
break
|
break
|
||||||
case HLS.ErrorTypes.MEDIA_ERROR:
|
case HLS.ErrorTypes.MEDIA_ERROR:
|
||||||
|
// 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()
|
hls.recoverMediaError()
|
||||||
|
}
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
// Unrecoverable - destroy and let the user retry
|
|
||||||
hls.destroy()
|
hls.destroy()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user