pub struct LegacyPlayer<B: PlayerBackend> {
inner: B,
capabilities: Capabilities,
has_item: bool,
}Fields§
§inner: B§capabilities: CapabilitiesDeclared at construction: this wrapper is generic over engines with very different abilities, and only the composition root knows which one it just built. Guessing here would reintroduce exactly the inference DR-238 removed.
has_item: boolThe old trait has no notion of “opening”, so this is the best the wrapper can do: it knows an item was handed over, not whether the engine is ready for one. That gap is the whole problem.
Implementations§
Source§impl<B: PlayerBackend> LegacyPlayer<B>
impl<B: PlayerBackend> LegacyPlayer<B>
pub fn new(inner: B, capabilities: Capabilities) -> Self
Trait Implementations§
Source§impl<B: PlayerBackend + Send> MediaPlayer for LegacyPlayer<B>
impl<B: PlayerBackend + Send> MediaPlayer for LegacyPlayer<B>
Source§fn open(&mut self, req: OpenRequest) -> Result<(), PlayerError>
fn open(&mut self, req: OpenRequest) -> Result<(), PlayerError>
Load, play, then seek — the sequence every caller used to write.
The seek is issued immediately, because a caller has no way to know when the engine becomes ready. On an engine whose load is asynchronous it fails and is discarded, and playback begins at zero: DR-241, reproduced.
Source§fn set_muted(&mut self, _muted: bool) -> Result<(), PlayerError>
fn set_muted(&mut self, _muted: bool) -> Result<(), PlayerError>
The old trait has no mute. Folding it into volume would lose the user’s level, so this reports unsupported rather than pretending.