pub struct VideoPlayer { /* private fields */ }Expand description
A player for one piece of video.
Implementations§
Source§impl VideoPlayer
impl VideoPlayer
Sourcepub fn new(ident: impl Into<Ident>) -> Self
pub fn new(ident: impl Into<Ident>) -> Self
A player with no transport and no frames, which is a player that says there is no playback here.
pub fn title(self, title: impl Into<SharedString>) -> Self
Sourcepub fn transport(self, transport: Rc<dyn MediaTransport>) -> Self
pub fn transport(self, transport: Rc<dyn MediaTransport>) -> Self
The player behind the controls.
Sourcepub fn frame(
self,
supplier: impl Fn(&mut Window, &mut App) -> Option<AnyElement> + 'static,
) -> Self
pub fn frame( self, supplier: impl Fn(&mut Window, &mut App) -> Option<AnyElement> + 'static, ) -> Self
Supplies the element that draws the current frame.
Answering None is a statement, not a gap: the surface falls back to
the poster and says why the picture is not moving.
Sourcepub fn poster(
self,
supplier: impl Fn(&mut Window, &mut App) -> Option<AnyElement> + 'static,
) -> Self
pub fn poster( self, supplier: impl Fn(&mut Window, &mut App) -> Option<AnyElement> + 'static, ) -> Self
Supplies the still shown when there are no frames.
Sourcepub fn ratio_of(self, width: f32, height: f32) -> Self
pub fn ratio_of(self, width: f32, height: f32) -> Self
The picture’s shape as the two numbers the caller already has.
Sourcepub fn elapsed(self, elapsed: impl Into<SharedString>) -> Self
pub fn elapsed(self, elapsed: impl Into<SharedString>) -> Self
How far in the video is, in the host’s own words.
Sourcepub fn remaining(self, remaining: impl Into<SharedString>) -> Self
pub fn remaining(self, remaining: impl Into<SharedString>) -> Self
How much is left, in the host’s own words.
Sourcepub fn step_seconds(self, seconds: f32) -> Self
pub fn step_seconds(self, seconds: f32) -> Self
How far one arrow key jumps, in seconds.
Sourcepub fn speeds(self, speeds: impl IntoIterator<Item = f32>) -> Self
pub fn speeds(self, speeds: impl IntoIterator<Item = f32>) -> Self
The speeds the transport offers. Offering none leaves the control out.
pub fn on_event( self, handler: impl Fn(&MediaEvent, &mut Window, &mut App) + 'static, ) -> Self
Trait Implementations§
Source§impl Debug for VideoPlayer
impl Debug for VideoPlayer
Source§impl Disableable for VideoPlayer
impl Disableable for VideoPlayer
Source§impl IntoElement for VideoPlayer
impl IntoElement for VideoPlayer
Source§type Element = ViewElement<VideoPlayer>
type Element = ViewElement<VideoPlayer>
The specific type of element into which the implementing type is converted.
Useful for converting other types into elements automatically, like Strings
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Convert self into a type that implements
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
Convert self into a dynamically-typed
AnyElement.Source§impl RenderOnce for VideoPlayer
impl RenderOnce for VideoPlayer
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render this component into an element tree. Note that this method
takes ownership of self, as compared to
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for VideoPlayer
impl !Send for VideoPlayer
impl !Sync for VideoPlayer
impl !UnwindSafe for VideoPlayer
impl Freeze for VideoPlayer
impl Unpin for VideoPlayer
impl UnsafeUnpin for VideoPlayer
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with an animation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<E> Flipping for Ewhere
E: IntoElement,
impl<E> Flipping for Ewhere
E: IntoElement,
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Imperatively modify self with the given closure.
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more