From 5e51c1ea5d4d2b65ceff0d86b471453b006fde9a Mon Sep 17 00:00:00 2001 From: 4gray <4gray@users.noreply.github.com> Date: Thu, 3 Sep 2026 09:43:33 +0200 Subject: [PATCH] fix(playback): route non-HLS containers to the native source path (#1510) The HTML5 player chose its engine by exclusion: anything that was not mpd/ts/mp4 went to hls.js, so .mkv (the default Xtream series/VOD container), .webm, .avi, .mov and .m4v were fed to hls.js as manifests. hls.js raised a manifest error and the player showed the network/provider diagnostic over media Chromium plays natively. Add resolvePlaybackUrlSourceKind() to @iptvnator/playback/util as the one URL-to-engine rule (mpd -> dash, m3u8/m3u -> hls, ts/m2ts/extension-less -> mpegts, everything else -> native) and read it from both the HTML5 player and ArtPlayer's getArtPlayerVideoType(), so the two engines agree. ArtPlayer serves every native container through a single ART_PLAYER_NATIVE_SOURCE_TYPE custom type, keeping the source session the owner of teardown and controls binding. The HTML5 native carries the video/mp4 hint only for MP4-family files: a hint the browser's canPlayType() rejects makes it skip the source, and Chromium demuxes containers it does not advertise there. Co-Authored-By: Claude Fable 5.1 --- .changes/playback-native-container-routing.md | 9 ++++ CLAUDE.md | 9 +++- docs/architecture/embedded-inline-playback.md | 21 +++++++-- docs/architecture/m3u-playlist-module.md | 5 +- libs/playback/util/src/index.ts | 1 + .../src/lib/playback-source-routing.spec.ts | 43 +++++++++++++++++ .../util/src/lib/playback-source-routing.ts | 46 +++++++++++++++++++ .../lib/art-player/art-player-setup.spec.ts | 19 +++++++- .../src/lib/art-player/art-player-setup.ts | 39 ++++++++++------ .../art-player/art-player-source-session.ts | 4 +- .../art-player.component.spec-fixtures.ts | 2 +- .../art-player/art-player.component.spec.ts | 8 +++- ...o-player.component.shared-controls.spec.ts | 43 +++++++++++++++++ .../html-video-player.component.ts | 19 +++++--- .../web-video-native-source.util.ts | 24 +++++++++- 15 files changed, 257 insertions(+), 35 deletions(-) create mode 100644 .changes/playback-native-container-routing.md create mode 100644 libs/playback/util/src/lib/playback-source-routing.spec.ts create mode 100644 libs/playback/util/src/lib/playback-source-routing.ts diff --git a/.changes/playback-native-container-routing.md b/.changes/playback-native-container-routing.md new file mode 100644 index 000000000..a70f3312a --- /dev/null +++ b/.changes/playback-native-container-routing.md @@ -0,0 +1,9 @@ +--- +type: fix +area: playback +--- + +The built-in HTML5 player now plays `.mkv`, `.webm`, `.avi`, `.mov` and other +non-HLS video files directly instead of handing them to the HLS engine, which +failed with a "network or provider loading error" on many Xtream episodes and +movies. ArtPlayer and the HTML5 player now choose their engine by the same rule. diff --git a/CLAUDE.md b/CLAUDE.md index 19a014fc8..8238f23a2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -815,7 +815,14 @@ app as a real argument, so it is not an option. **Video Players**: -- Built-in web players: HTML5+hls.js, Video.js, and ArtPlayer +- Built-in web players: HTML5+hls.js, Video.js, and ArtPlayer. The HTML5 + player and ArtPlayer pick their source engine from one URL rule, + `resolvePlaybackUrlSourceKind()` in `libs/playback/util` (`mpd` → Shaka, + `m3u8`/`m3u` → hls.js, `ts`/`m2ts`/extension-less → mpegts.js, every other + container → native `