pub struct MoviePlayer { /* private fields */ }Expand description
Plays a Movie as an interactive manual.
Whoever watches can pause, drag the position, jump to a chapter and click the
marks on the film. With “stop at each step” on, which is how it starts, the
film holds at each Recorder::guide until the marked spot is clicked,
so people follow it at their own pace. It sleeps while paused.
Cloning a film is cheap, since the film itself is shared:
use ravenrs_movie::{Movie, MoviePlayer};
let movie = Movie::from_bytes(&std::fs::read("manual.ravenmovie").unwrap_or_default())?;
let player = MoviePlayer::new(movie).width(960.0);Implementations§
Source§impl MoviePlayer
impl MoviePlayer
Sourcepub fn next(self, title: impl Into<String>, open: impl Fn() + 'static) -> Self
pub fn next(self, title: impl Into<String>, open: impl Fn() + 'static) -> Self
What comes after this film, offered when it ends.
Sourcepub fn on_finished(self, finished: impl Fn() + 'static) -> Self
pub fn on_finished(self, finished: impl Fn() + 'static) -> Self
Runs when the film reaches its end.
Sourcepub fn max_film_height(self, height: f32) -> Self
pub fn max_film_height(self, height: f32) -> Self
The film is no taller than this, and the chapters take the width it leaves. For a player that should fit a window with its controls in view.
Sourcepub fn width(self, width: f32) -> Self
pub fn width(self, width: f32) -> Self
The width of the whole player, in logical pixels (960 by default). The film gets what its chapters leave.
Sourcepub fn narration(self, narration: Narration) -> Self
pub fn narration(self, narration: Narration) -> Self
Recordings of what the film says, in place of the system’s voice. What is not among them is still said by the system’s voice.
Sourcepub fn logo(self, logo: LottieAnimation) -> Self
pub fn logo(self, logo: LottieAnimation) -> Self
The app’s animated logo, played on the film’s opening and farewell cards.
Sourcepub fn labels(self, labels: MovieLabels) -> Self
pub fn labels(self, labels: MovieLabels) -> Self
The words it shows.
Trait Implementations§
Source§impl Debug for MoviePlayer
impl Debug for MoviePlayer
Auto Trait Implementations§
impl !RefUnwindSafe for MoviePlayer
impl !Send for MoviePlayer
impl !Sync for MoviePlayer
impl !UnwindSafe for MoviePlayer
impl Freeze for MoviePlayer
impl Unpin for MoviePlayer
impl UnsafeUnpin for MoviePlayer
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
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
None keeps the content size.