pub struct Video {
pub source: String,
pub format: VideoFormat,
pub x: u32,
pub y: u32,
pub width: u32,
pub height: u32,
pub options: VideoOptions,
pub poster: Option<String>,
pub alt_text: Option<String>,
}Expand description
Video element
Fields§
§source: StringVideo file path or URL
format: VideoFormatVideo format
x: u32Position X in EMU
y: u32Position Y in EMU
width: u32Width in EMU
height: u32Height in EMU
options: VideoOptionsPlayback options
poster: Option<String>Poster image (thumbnail)
alt_text: Option<String>Alt text
Implementations§
Source§impl Video
impl Video
Sourcepub fn new(
source: &str,
format: VideoFormat,
x: u32,
y: u32,
width: u32,
height: u32,
) -> Self
pub fn new( source: &str, format: VideoFormat, x: u32, y: u32, width: u32, height: u32, ) -> Self
Create a new video element
Sourcepub fn from_file(
path: &str,
x: u32,
y: u32,
width: u32,
height: u32,
) -> Option<Self>
pub fn from_file( path: &str, x: u32, y: u32, width: u32, height: u32, ) -> Option<Self>
Create from file path (auto-detect format)
Sourcepub fn with_options(self, options: VideoOptions) -> Self
pub fn with_options(self, options: VideoOptions) -> Self
Set playback options
Sourcepub fn with_poster(self, poster: &str) -> Self
pub fn with_poster(self, poster: &str) -> Self
Set poster image
Sourcepub fn with_alt_text(self, alt: &str) -> Self
pub fn with_alt_text(self, alt: &str) -> Self
Set alt text
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Video
impl RefUnwindSafe for Video
impl Send for Video
impl Sync for Video
impl Unpin for Video
impl UnsafeUnpin for Video
impl UnwindSafe for Video
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more