Expand description
Audio playback abstraction for the engine’s media widgets.
The engine lays out and drives UI widgets such as the <audio> control,
but it must not own an audio device: decoding, output device selection
and stream management are platform concerns. This module defines the
interface the engine uses to talk to whatever the host environment
provides, mirroring crate::engine::bridge::text for text measurement.
§Responsibilities
- Accept a media source (fetched bytes and/or a URI) and start playback
- Expose transport controls (pause/resume) and playback position
- Report whether the decoded source has finished
§Non-Responsibilities
- Deciding when to play (the engine’s widget drives that)
- Fetching media bytes (that goes through the resource loader)
§Data Flow
<audio> element → AudioSinkFactory → AudioSink → platform audio deviceStructs§
- Null
Audio Sink Factory - A factory producing sinks that decode and play nothing.
Enums§
- Audio
Error - Failures surfaced by an
AudioSink.
Traits§
- Audio
Sink - A single playable audio source.
- Audio
Sink Factory - Creates one
AudioSinkper media element.