mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-16 14:16:16 -08:00
fix(playback): treat mpegts early eof as media fallback
Entire-Checkpoint: f957cd9849e0
This commit is contained in:
1 parent
c3ef581b6f
commit
d190fa0341
4 files changed
+36
No files matched your search
@@ -244,6 +244,25 @@ describe('playback diagnostics', () => {
|
||||
expect(issue.externalFallbackRecommended).toBe(true);
|
||||
});
|
||||
|
||||
it('classifies mpegts early EOF failures as fallback-actionable media errors', () => {
|
||||
const issue = classifyMpegTsPlaybackIssue(
|
||||
{
|
||||
type: 'NetworkError',
|
||||
details: 'UnrecoverableEarlyEof',
|
||||
info: { msg: 'Fetch stream meet Early-EOF' },
|
||||
},
|
||||
createPlaybackSourceMetadata({
|
||||
url: 'https://provider.example/movie/123.ts',
|
||||
mimeType: 'video/mp2t',
|
||||
player: 'videojs',
|
||||
})
|
||||
);
|
||||
|
||||
expect(issue.code).toBe(PlaybackDiagnosticCode.MediaDecodeError);
|
||||
expect(issue.externalFallbackRecommended).toBe(true);
|
||||
expect(issue.details).toContain('Early-EOF');
|
||||
});
|
||||
|
||||
it('classifies mpegts codec errors as unsupported codec fallbacks', () => {
|
||||
const issue = classifyMpegTsPlaybackIssue(
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
isBrowserAccessFailure,
|
||||
isCodecFailure,
|
||||
isDrmOrEncryptionFailure,
|
||||
isEarlyEofFailure,
|
||||
isNetworkFailure,
|
||||
normalizeErrorDetails,
|
||||
} from './playback-error-patterns.util';
|
||||
@@ -152,6 +153,15 @@ export function classifyMpegTsPlaybackIssue(
|
||||
const lowerDetails = details.toLowerCase();
|
||||
const lowerType = (error.type ?? '').toLowerCase();
|
||||
|
||||
if (isEarlyEofFailure(lowerDetails)) {
|
||||
return createDiagnostic({
|
||||
code: DiagnosticCode.MediaDecodeError,
|
||||
source: DiagnosticSource.MpegTs,
|
||||
metadata,
|
||||
details,
|
||||
});
|
||||
}
|
||||
|
||||
if (isNetworkFailure(lowerType, lowerDetails)) {
|
||||
return createDiagnostic({
|
||||
code: isBrowserAccessFailure(lowerDetails)
|
||||
|
||||
@@ -45,6 +45,11 @@ export function isBrowserAccessFailure(details: string): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
export function isEarlyEofFailure(details: string): boolean {
|
||||
const compactDetails = details.replace(/[^a-z0-9]/g, '');
|
||||
return compactDetails.includes('earlyeof');
|
||||
}
|
||||
|
||||
export function isCodecFailure(details: string): boolean {
|
||||
return (
|
||||
details.includes('codec') ||
|
||||
|
||||
Reference in new issue
Block a user