pub trait VideoPlayer: Send {
// Required methods
fn poll(&mut self) -> Result<VideoStatus, String>;
fn frame(&mut self) -> Option<VideoFrame>;
fn play(&mut self) -> Result<(), String>;
fn pause(&mut self) -> Result<(), String>;
fn seek(&mut self, to: Duration) -> Result<(), String>;
fn set_volume(&mut self, volume: f32);
// Provided methods
fn set_looping(&mut self, on: bool) -> bool { ... }
fn loops(&self) -> u64 { ... }
}Expand description
A video being played. A failure’s text is shown in place of the picture (the viewer’s error page, for the viewer’s video).
Required Methods§
Sourcefn poll(&mut self) -> Result<VideoStatus, String>
fn poll(&mut self) -> Result<VideoStatus, String>
Takes what happened since the last call; an error ends the player.
Sourcefn frame(&mut self) -> Option<VideoFrame>
fn frame(&mut self) -> Option<VideoFrame>
The last frame not taken yet, the older ones forgotten.
fn play(&mut self) -> Result<(), String>
fn pause(&mut self) -> Result<(), String>
fn seek(&mut self, to: Duration) -> Result<(), String>
Sourcefn set_volume(&mut self, volume: f32)
fn set_volume(&mut self, volume: f32)
From 0 to 1.
Provided Methods§
Sourcefn set_looping(&mut self, on: bool) -> bool
fn set_looping(&mut self, on: bool) -> bool
Loops by itself from now on (or no longer), when it can: whether it does. By default it cannot, and the widget seeks back to the start when it ends.