pub struct Video { /* private fields */ }Expand description
Video widget (state, layout and draw commands).
Implementations§
Source§impl Video
impl Video
Sourcepub fn width(self, width: f32) -> Self
pub fn width(self, width: f32) -> Self
Set the intrinsic width.
Negative values become 0 and values above 1e15 are clamped to it; NaN
and infinities count as “not set”, so measure falls back to the
default width instead of reporting a non-finite size.
Sourcepub fn height(self, height: f32) -> Self
pub fn height(self, height: f32) -> Self
Set the intrinsic height (same rules as Video::width).
Sourcepub fn accessible_name(self, name: impl Into<String>) -> Self
pub fn accessible_name(self, name: impl Into<String>) -> Self
Set the accessible name.
Sourcepub const fn autoplay(self, autoplay: bool) -> Self
pub const fn autoplay(self, autoplay: bool) -> Self
Set autoplay; the video starts Playing when true, Paused when false.
Sourcepub fn get_poster(&self) -> Option<&str>
pub fn get_poster(&self) -> Option<&str>
Get the poster URI.
Sourcepub fn get_height(&self) -> Option<f32>
pub fn get_height(&self) -> Option<f32>
Get the intrinsic height.
Sourcepub const fn is_autoplay(&self) -> bool
pub const fn is_autoplay(&self) -> bool
Whether autoplay is set.
Sourcepub const fn has_controls(&self) -> bool
pub const fn has_controls(&self) -> bool
Whether controls are shown.
Sourcepub const fn state(&self) -> VideoState
pub const fn state(&self) -> VideoState
Get the playback state.
Sourcepub const fn is_playing(&self) -> bool
pub const fn is_playing(&self) -> bool
Whether the video is playing.
Sourcepub fn play_glyph(&self) -> [Point; 3]
pub fn play_glyph(&self) -> [Point; 3]
The three vertices of the play glyph, centred in the laid-out bounds.
The bounding box of the triangle has the same centre as the bounds.
Every vertex is finite and inside the sanitised laid-out bounds, whatever
rectangle was passed to layout.
Trait Implementations§
Source§impl Brick for Video
impl Brick for Video
Source§fn brick_name(&self) -> &'static str
fn brick_name(&self) -> &'static str
Source§fn assertions(&self) -> &[BrickAssertion]
fn assertions(&self) -> &[BrickAssertion]
Source§fn budget(&self) -> BrickBudget
fn budget(&self) -> BrickBudget
Source§fn verify(&self) -> BrickVerification
fn verify(&self) -> BrickVerification
Source§fn can_render(&self) -> bool
fn can_render(&self) -> bool
Source§impl<'de> Deserialize<'de> for Video
impl<'de> Deserialize<'de> for Video
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Widget for Video
impl Widget for Video
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Lay the video out in bounds.
The bounds are stored as given, so verify can judge them (like Grid
and Waveform). They are sanitised where they are used (NaN and
infinities become 0, components are clamped to +-1e15, a negative size
becomes 0), so every rect and glyph vertex paint emits is finite and
the returned size is finite and not negative.