fix(player): ExoPlayer can seek a transcode in place; mpv cannot
A regression I introduced in DR-246 and did not catch, because the capability was declared once for "native engines" as though being native were the property that mattered. It is not. Speaking HLS is. ExoPlayer is a full HLS client: like hls.js it seeks within the VOD playlist it was handed and lets the server catch up. mpv's HLS demuxer will not make the server produce segments from a new offset, so it has to re-open the stream. Grouping them together declared false for both, so on Android a transcoded seek began re-opening the stream where it previously seeked in place — the same class of defect DR-238 was about, reintroduced on the platform I had not exercised. Capabilities::native() is gone, replaced by mpv() and exoplayer(), and the composition root chooses per platform through engine_capabilities(). Treating a category as a proxy for an ability is precisely the inference this design removes; a helper named after the category invited it straight back in. Not yet verified on a device. The conformance cases run against JellyTauPlayer in isolation and do not cover a transcoded seek, PiP, background audio or the media session — none of which have been exercised since the controller port.
This commit is contained in:
@@ -139,12 +139,12 @@ pub struct Capabilities {
|
||||
}
|
||||
|
||||
impl Capabilities {
|
||||
/// What a native engine of this project's kind can do.
|
||||
/// mpv.
|
||||
///
|
||||
/// `seeks_transcoded_in_place` is false: both native engines decode the
|
||||
/// stream themselves and neither can make the server transcode from a new
|
||||
/// offset. hls.js is the exception, and says so for itself.
|
||||
pub fn native() -> Self {
|
||||
/// Cannot seek a server-side transcode in place: its HLS demuxer will not
|
||||
/// make the server produce segments from a new offset, so the stream has to
|
||||
/// be re-opened.
|
||||
pub fn mpv() -> Self {
|
||||
Self {
|
||||
video: true,
|
||||
audio_settings: true,
|
||||
@@ -154,6 +154,24 @@ impl Capabilities {
|
||||
}
|
||||
}
|
||||
|
||||
/// ExoPlayer.
|
||||
///
|
||||
/// **Can** seek a transcode in place. It is a full HLS client, so like
|
||||
/// hls.js it seeks within the VOD playlist it was handed and lets the
|
||||
/// server catch up. Grouping it with mpv as "a native engine" gets this
|
||||
/// exactly backwards — being native is not the property that matters here,
|
||||
/// speaking HLS is, and that is the whole reason this is declared per
|
||||
/// engine rather than inferred from a category.
|
||||
pub fn exoplayer() -> Self {
|
||||
Self {
|
||||
video: true,
|
||||
audio_settings: true,
|
||||
subtitle_switching: true,
|
||||
audio_track_switching: true,
|
||||
seeks_transcoded_in_place: true,
|
||||
}
|
||||
}
|
||||
|
||||
/// An engine that renders through the webview element, where hls.js seeks
|
||||
/// within the playlist it was handed.
|
||||
pub fn webview() -> Self {
|
||||
|
||||
@@ -2253,7 +2253,7 @@ impl Default for PlayerController {
|
||||
Self::new(
|
||||
Box::new(LegacyPlayer::new(
|
||||
NullBackend::new(),
|
||||
crate::player::media_player::Capabilities::native(),
|
||||
crate::player::media_player::Capabilities::mpv(),
|
||||
)),
|
||||
playback_reporter,
|
||||
position_throttler,
|
||||
|
||||
Reference in New Issue
Block a user