pub struct Video(/* private fields */);Expand description
A raw video view that displays video without native controls.
Use this component when you want to display video content and build
your own custom UI controls. For a full-featured player with native
controls, use VideoPlayer instead.
§Platform Implementation
- iOS/macOS: Uses
AVPlayerLayerdirectly - Android: Uses
SurfaceViewwith ExoPlayer
Implementations§
Source§impl Video
impl Video
Sourcepub fn new(source: impl IntoComputed<Url>) -> Video
pub fn new(source: impl IntoComputed<Url>) -> Video
Creates a new raw video view.
Sourcepub const fn aspect_ratio(self, aspect_ratio: AspectRatio) -> Video
pub const fn aspect_ratio(self, aspect_ratio: AspectRatio) -> Video
Sets the aspect ratio mode for the video.
Sourcepub const fn loops(self, loops: bool) -> Video
pub const fn loops(self, loops: bool) -> Video
Sets whether the video should loop when it ends.
Sourcepub fn on_event(self, handler: impl Fn(Event) + 'static) -> Video
pub fn on_event(self, handler: impl Fn(Event) + 'static) -> Video
Sets the event handler for video events.
Trait Implementations§
Source§impl ConfigurableView for Video
impl ConfigurableView for Video
Source§impl From<VideoConfig> for Video
impl From<VideoConfig> for Video
Source§fn from(value: VideoConfig) -> Video
fn from(value: VideoConfig) -> Video
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Video
impl !RefUnwindSafe for Video
impl !Send for Video
impl !Sync for Video
impl Unpin for Video
impl !UnwindSafe for Video
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> IdentifiableExt for T
impl<T> IdentifiableExt for T
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<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn metadata<T: MetadataKey>(self, metadata: T) -> Metadata<T>
fn metadata<T: MetadataKey>(self, metadata: T) -> Metadata<T>
Attaches metadata to a view. Read more
Source§fn with<T: 'static>(self, value: T) -> With<Self, T>
fn with<T: 'static>(self, value: T) -> With<Self, T>
Associates a value with this view in the environment.
Source§fn title(self, title: impl Into<Text>) -> NavigationView
fn title(self, title: impl Into<Text>) -> NavigationView
Sets this view as the content of a navigation view with the specified title. Read more
Source§fn focused<T: 'static + Eq + Clone>(
self,
value: &Binding<Option<T>>,
equals: T,
) -> Metadata<Focused>
fn focused<T: 'static + Eq + Clone>( self, value: &Binding<Option<T>>, equals: T, ) -> Metadata<Focused>
Marks this view as focused when the binding matches the specified value. Read more
Source§fn on_change<C, F>(self, source: &C, handler: F) -> OnChange<Self, C::Guard>
fn on_change<C, F>(self, source: &C, handler: F) -> OnChange<Self, C::Guard>
Monitors a signal for changes and triggers a handler when the signal’s value changes. Read more
Source§fn task<Fut>(self, task: Fut) -> Metadata<Retain>
fn task<Fut>(self, task: Fut) -> Metadata<Retain>
Spawns an asynchronous task tied to the lifecycle of this view. Read more
Source§fn background(self, background: impl Into<Background>) -> Metadata<Background>
fn background(self, background: impl Into<Background>) -> Metadata<Background>
Sets the background of this view. Read more
Source§fn foreground(
self,
color: impl IntoComputed<Color>,
) -> Metadata<ForegroundColor>
fn foreground( self, color: impl IntoComputed<Color>, ) -> Metadata<ForegroundColor>
Sets the foreground color of this view. Read more
Source§fn event<H: 'static>(
self,
event: Event,
handler: impl HandlerFnOnce<H, ()> + 'static,
) -> Metadata<OnEvent>
fn event<H: 'static>( self, event: Event, handler: impl HandlerFnOnce<H, ()> + 'static, ) -> Metadata<OnEvent>
Adds an event handler for the specified event. Read more
Source§fn on_disappear<H: 'static>(
self,
handler: impl HandlerFnOnce<H, ()> + 'static,
) -> Metadata<OnEvent>
fn on_disappear<H: 'static>( self, handler: impl HandlerFnOnce<H, ()> + 'static, ) -> Metadata<OnEvent>
Adds a handler that triggers when the view disappears. Read more
Source§fn on_appear<H: 'static>(
self,
handler: impl HandlerFnOnce<H, ()> + 'static,
) -> Metadata<OnEvent>
fn on_appear<H: 'static>( self, handler: impl HandlerFnOnce<H, ()> + 'static, ) -> Metadata<OnEvent>
Adds a handler that triggers when the view appears. Read more
Source§fn min_height(self, height: f32) -> Frame
fn min_height(self, height: f32) -> Frame
Applies a minimum height constraint.
Source§fn max_height(self, height: f32) -> Frame
fn max_height(self, height: f32) -> Frame
Applies a maximum height constraint.
Source§fn alignment(self, alignment: Alignment) -> Frame
fn alignment(self, alignment: Alignment) -> Frame
Aligns this view within its frame using the provided alignment.
Source§fn padding_with(self, edge: impl Into<EdgeInsets>) -> Padding
fn padding_with(self, edge: impl Into<EdgeInsets>) -> Padding
Adds padding to this view with custom edge insets. Read more
Source§fn tag<T>(self, tag: T) -> TaggedView<T, Self>
fn tag<T>(self, tag: T) -> TaggedView<T, Self>
Tags this view with a custom tag for identification. Read more
Source§fn a11y_label(
self,
label: impl Into<Str>,
) -> IgnorableMetadata<AccessibilityLabel>
fn a11y_label( self, label: impl Into<Str>, ) -> IgnorableMetadata<AccessibilityLabel>
Sets the accessibility label for this view. Read more
Source§fn a11y_role(
self,
role: AccessibilityRole,
) -> IgnorableMetadata<AccessibilityRole>
fn a11y_role( self, role: AccessibilityRole, ) -> IgnorableMetadata<AccessibilityRole>
Sets the accessibility role for this view. Read more
Source§fn gesture<P: 'static>(
self,
gesture: impl Into<Gesture>,
action: impl HandlerFn<P, ()> + 'static,
) -> Metadata<GestureObserver>
fn gesture<P: 'static>( self, gesture: impl Into<Gesture>, action: impl HandlerFn<P, ()> + 'static, ) -> Metadata<GestureObserver>
Observes a gesture and executes an action when the gesture is recognized. Read more
Source§fn on_tap<P: 'static>(
self,
action: impl HandlerFn<P, ()> + 'static,
) -> Metadata<GestureObserver>
fn on_tap<P: 'static>( self, action: impl HandlerFn<P, ()> + 'static, ) -> Metadata<GestureObserver>
Adds a tap gesture recognizer to this view that triggers the specified action. Read more
Source§fn shadow(self, shadow: impl Into<Shadow>) -> Metadata<Shadow>
fn shadow(self, shadow: impl Into<Shadow>) -> Metadata<Shadow>
Applies a shadow effect to this view.
Source§fn ignore_safe_area(self, edges: EdgeSet) -> Metadata<IgnoreSafeArea>
fn ignore_safe_area(self, edges: EdgeSet) -> Metadata<IgnoreSafeArea>
Extends this view’s bounds to ignore safe area insets on the specified edges. Read more