pub struct MediaView {
pub start_row: u32,
pub end_row: u32,
pub kind: MediaKind,
pub src: String,
pub poster: String,
pub alt: String,
pub sources: Vec<MediaSourceView>,
}Expand description
One block-level image, video, or audio: which rows core reserved for it and
what to build there. The peer of leaf_core::MediaInfo, and the media
analogue of DirectiveView — a frontend skips the rows in
start_row..end_row and lays its own view over them, rather than painting
the 🖼/🎬/🔊 placeholder glyphs core put there for a surface that can’t.
Fields§
§start_row: u32The DocView::rows indices the placeholder occupies.
end_row: u32§kind: MediaKindWhich of the three this is — the view to build.
src: StringThe URL to load, already resolved against the current appearance (see
LeafDoc::set_dark_appearance). A relative path resolves against the
document’s own directory, which core does not know — the host does.
Empty only when a <video>/<audio> named neither a src nor a
<source>, which is a broken document.
poster: StringA <video>’s poster frame URL, or empty. An image destination, so it
loads exactly as an image src does — worth showing before the movie is
ready, or in place of one that won’t play.
alt: StringThe alt / fallback text, for the view’s accessibility label.
sources: Vec<MediaSourceView>The <source> alternatives in document order; empty for a plain image.