pub struct AudioRenderer;Expand description
Renderer for audio embeds: ![[song.mp3]] → <audio controls>.
preload=metadata so the browser fetches duration/sample-rate but not the
full payload until the user presses play.
Output form: <audio><source src="..." type="..."></audio> (HTML5
multi-source). This is safe today because no audio extension rewriter
exists in src-tauri — audio files pass through unchanged. If a future
converter is introduced (e.g., .flac→.mp3 for size, .m4a→.opus for
browser parity, see #504), this renderer must switch to the single
src= form for the same reason VideoRenderer did: the
add_*_placeholder_attributes regex pattern in
src-tauri/src/build/media/placeholder.rs matches <tag\s+[^>]*?src=>,
not nested <source> children. See #593 and the docstring on
VideoRenderer for the full failure mode.
Trait Implementations§
Source§impl Debug for AudioRenderer
impl Debug for AudioRenderer
Source§impl EmbedRenderer for AudioRenderer
impl EmbedRenderer for AudioRenderer
Source§fn extensions(&self) -> &[&'static str]
fn extensions(&self) -> &[&'static str]
Source§fn render(&self, embed: &ParsedEmbed<'_>) -> RenderedEmbed
fn render(&self, embed: &ParsedEmbed<'_>) -> RenderedEmbed
Source§fn head_assets(&self) -> &[&'static str]
fn head_assets(&self) -> &[&'static str]
<head>, injected
once per page that contains at least one embed from this renderer. Read more