pub struct VideoTrack { /* private fields */ }Expand description
Seekable cross-platform video playback track with poster frame, timed frames, volume, speed, and captions.
Implementations§
Source§impl VideoTrack
Transport playback, seeking, captions, and sample builder for VideoTrack.
impl VideoTrack
Transport playback, seeking, captions, and sample builder for VideoTrack.
Sourcepub fn sample_hdr_video() -> Self
pub fn sample_hdr_video() -> Self
Generates a deterministic 12-second sample video track with poster, timed frames, and closed captions.
§Returns
Self- ReadyVideoTrack.
Sourcepub fn toggle_play(&mut self)
pub fn toggle_play(&mut self)
Toggles between PlaybackState::Playing and PlaybackState::Paused.
§Arguments
&Self- Mutable video track.
Sourcepub fn seek(&mut self, secs: f32)
pub fn seek(&mut self, secs: f32)
Seeks playback position to secs, clamped to [0.0, duration_secs].
§Arguments
&Self- Mutable video track.f32- Target timestamp in seconds.
Sourcepub fn step(&mut self, dt_secs: f32)
pub fn step(&mut self, dt_secs: f32)
Advances video playback by dt_secs * playback_rate.
§Arguments
&Self- Mutable video track.f32- Elapsed wall delta time in seconds.
Sourcepub fn active_frame(&self) -> ImageBuffer
pub fn active_frame(&self) -> ImageBuffer
Sourcepub fn active_caption(&self) -> String
pub fn active_caption(&self) -> String
Source§impl VideoTrack
impl VideoTrack
pub fn get_metadata(&self) -> &MediaMetadata
pub fn get_mut_metadata(&mut self) -> &mut MediaMetadata
pub fn set_metadata(&mut self, val: MediaMetadata) -> &mut Self
pub fn get_codec(&self) -> VideoCodec
pub fn get_mut_codec(&mut self) -> &mut VideoCodec
pub fn set_codec(&mut self, val: VideoCodec) -> &mut Self
pub fn get_poster(&self) -> &ImageBuffer
pub fn get_mut_poster(&mut self) -> &mut ImageBuffer
pub fn set_poster(&mut self, val: ImageBuffer) -> &mut Self
pub fn get_frames(&self) -> &Vec<MediaFrame>
pub fn get_mut_frames(&mut self) -> &mut Vec<MediaFrame>
pub fn set_frames(&mut self, val: Vec<MediaFrame>) -> &mut Self
pub fn get_state(&self) -> PlaybackState
pub fn get_mut_state(&mut self) -> &mut PlaybackState
pub fn set_state(&mut self, val: PlaybackState) -> &mut Self
pub fn get_current_time_secs(&self) -> f32
pub fn get_mut_current_time_secs(&mut self) -> &mut f32
pub fn set_current_time_secs(&mut self, val: f32) -> &mut Self
pub fn get_volume(&self) -> f32
pub fn get_mut_volume(&mut self) -> &mut f32
pub fn set_volume(&mut self, val: f32) -> &mut Self
pub fn get_muted(&self) -> bool
pub fn get_mut_muted(&mut self) -> &mut bool
pub fn set_muted(&mut self, val: bool) -> &mut Self
pub fn get_playback_rate(&self) -> f32
pub fn get_mut_playback_rate(&mut self) -> &mut f32
pub fn set_playback_rate(&mut self, val: f32) -> &mut Self
pub fn get_looping(&self) -> bool
pub fn get_mut_looping(&mut self) -> &mut bool
pub fn set_looping(&mut self, val: bool) -> &mut Self
pub fn get_captions(&self) -> &Vec<String>
pub fn get_mut_captions(&mut self) -> &mut Vec<String>
pub fn set_captions(&mut self, val: Vec<String>) -> &mut Self
Trait Implementations§
Source§impl Clone for VideoTrack
impl Clone for VideoTrack
Source§impl Debug for VideoTrack
impl Debug for VideoTrack
Source§impl Default for VideoTrack
impl Default for VideoTrack
Source§impl PartialEq for VideoTrack
impl PartialEq for VideoTrack
impl StructuralPartialEq for VideoTrack
Auto Trait Implementations§
impl Forget for VideoTrack
impl Freeze for VideoTrackwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<MediaFrame>: Freeze,
PhantomData<String>: Freeze,
impl Move for VideoTrack
impl RefUnwindSafe for VideoTrack
impl Send for VideoTrackwhere
RawVecInner: Send,
impl Sync for VideoTrackwhere
RawVecInner: Sync,
impl Unpin for VideoTrack
impl UnsafeUnpin for VideoTrackwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<MediaFrame>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for VideoTrackwhere
RawVecInner: UnwindSafe,
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