pub struct Video {
pub id: Option<WidgetNodeId>,
pub source: String,
pub width: Option<f32>,
pub height: Option<f32>,
pub autoplay: bool,
pub loop_playback: bool,
}Expand description
A platform-native video player widget.
The video is rendered by the platform’s native player and embedded into the
Fission layout as an opaque surface. Use [BuildCtx::video_controls] to
create play/pause/seek action envelopes.
§Example
ⓘ
Video {
source: "https://example.com/clip.mp4".into(),
width: Some(640.0),
height: Some(360.0),
autoplay: true,
loop_playback: false,
..Default::default()
}Fields§
§id: Option<WidgetNodeId>Stable widget identity (auto-derived from source if None).
source: StringURL or asset path to the video file.
width: Option<f32>Fixed width in layout points.
height: Option<f32>Fixed height in layout points.
autoplay: boolWhether to start playing immediately.
loop_playback: boolWhether to loop playback when the video ends.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Video
impl<'de> Deserialize<'de> for Video
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Lower for Video
impl Lower for Video
Source§fn lower(&self, cx: &mut LoweringContext<'_>) -> NodeId
fn lower(&self, cx: &mut LoweringContext<'_>) -> NodeId
Lower this widget into the IR, returning the root node id.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.