mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 18:36:15 -08:00
fix(playback): align diagnostic followups
Entire-Checkpoint: f957cd9849e0
This commit is contained in:
1 parent
48f16c7148
commit
bbeb29b12b
3 files changed
+22
-5
No files matched your search
@@ -196,6 +196,22 @@ describe('playback diagnostics', () => {
|
||||
expect(issue.externalFallbackRecommended).toBe(true);
|
||||
});
|
||||
|
||||
it('keeps opaque native network failures generic when the browser hides access details', () => {
|
||||
const issue = classifyNativePlaybackIssue(
|
||||
{
|
||||
code: 2,
|
||||
message: '',
|
||||
},
|
||||
createPlaybackSourceMetadata({
|
||||
url: 'https://provider.example/live.m3u8',
|
||||
player: 'html5',
|
||||
})
|
||||
);
|
||||
|
||||
expect(issue.code).toBe(PlaybackDiagnosticCode.NetworkError);
|
||||
expect(issue.externalFallbackRecommended).toBe(false);
|
||||
});
|
||||
|
||||
it('classifies mpegts browser fetch restrictions separately from generic network errors', () => {
|
||||
const issue = classifyMpegTsPlaybackIssue(
|
||||
{
|
||||
|
||||
@@ -236,6 +236,9 @@ export function classifyNativePlaybackIssue(
|
||||
const lowerNativeErrorMessage = nativeErrorMessage?.toLowerCase() ?? '';
|
||||
|
||||
if (nativeErrorCode === NETWORK_ERROR_CODE) {
|
||||
// Native MediaError details are often opaque for browser security
|
||||
// failures. Only classify browser access when the runtime exposes a
|
||||
// concrete CORS/mixed-content/CSP-style message.
|
||||
return createDiagnostic({
|
||||
code: isBrowserAccessFailure(lowerNativeErrorMessage)
|
||||
? PlaybackDiagnosticCode.BrowserAccessError
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
Output,
|
||||
Signal,
|
||||
ViewEncapsulation,
|
||||
computed,
|
||||
effect,
|
||||
inject,
|
||||
input,
|
||||
output,
|
||||
signal,
|
||||
} from '@angular/core';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
@@ -71,12 +70,11 @@ export class WebPlayerViewComponent {
|
||||
volume = input<number>(1);
|
||||
showCaptions = input<boolean>(false);
|
||||
playerOverride = input<VideoPlayer | null>(null);
|
||||
@Output() timeUpdate = new EventEmitter<{
|
||||
readonly timeUpdate = output<{
|
||||
currentTime: number;
|
||||
duration: number;
|
||||
}>();
|
||||
@Output() externalFallbackRequested =
|
||||
new EventEmitter<PlaybackFallbackRequest>();
|
||||
readonly externalFallbackRequested = output<PlaybackFallbackRequest>();
|
||||
|
||||
settings = toSignal(
|
||||
this.storage.get(STORE_KEY.Settings)
|
||||
|
||||
Reference in new issue
Block a user