mirror of
https://github.com/NuvioMedia/NuvioMobile.git
synced 2026-08-14 19:23:41 +00:00
Plugin scrapers (and some non-standard addons) declare the manifest
format of their links via a "type" field ("hls", "dash") on the
stream object. PluginRuntime already parses it into
PluginRuntimeResult.type, but both toStreamItem conversions dropped
it, and PlayerEngine.android.kt built MediaItems with no MIME type,
leaving ExoPlayer to infer the format from the URL extension. For
HLS links whose URL hides the .m3u8 behind tokens or rewriters
(https://cdn.example.com/playlist?token=…), inference fails and
playback errors or stalls.
This change:
- Adds a streamType field to StreamItem, populated from stream.type
in StreamParser, MetaDetailsParser embedded streams, and both
PluginRuntimeResult.toStreamItem conversions (StreamsRepository and
PlayerStreamsRepository).
- Plumbs the value through PlayerLaunch / PlayerScreen /
PlatformPlayerSurface and the in-player source-switch paths.
Switches to P2P sentinels and downloaded local files reset the
value to null so a stale "hls" can never mislabel the next source.
streamType participates in the player rebuild keys so a source
change always rebuilds with the right MIME.
- Persists streamType in the Reuse Last Link cache (defaulted
serializable field, old payloads stay decodable) so a typed HLS
stream that played once keeps working through link reuse.
- In playbackMediaItemFromUrl, the declared type takes precedence
over response-header and URL-path inference, mapping "hls"/"m3u8" →
APPLICATION_M3U8, "dash"/"mpd" → APPLICATION_MPD,
"ss"/"smoothstreaming" → APPLICATION_SS. Unrecognized values
(including Stremio's content-type semantics like "movie"/"series")
fall through to the existing inference chain unchanged.
The official Stremio stream spec defines no top-level type field, so
the Stremio-addon parsing is best-effort; the reliable emitters are
plugin scrapers, whose results previously lost the field entirely.
Scopes down to #1244 only. #1246 (User-Agent override) is already
fixed in the current PlayerPlaybackNetworking.createHttpDataSourceFactory,
which skips setUserAgent when caller-supplied headers declare one.
Fixes #1244
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| jniLibs | ||
| kotlin/com/nuvio/app | ||
| res | ||
| AndroidManifest.xml | ||