shaffex

VideoView

Description

A view that plays a video from a URL or a file path. It provides controls for playback, volume, and appearance.

Parameters

Examples

Basic Video Player

This example shows a simple video player that plays a remote video file.

<body>
    <videoview src="url:https://shaffex.com/MagicUiDemo/Resources/TestVideo.mp4" videoGravity="resizeAspect"/>
</body>

Screenshot


Autoplaying Video without Controls

This example shows a video that autoplays in a loop without any visible playback controls, serving as a background video.

<body>
    <videoview src="url:https://shaffex.com/MagicUiDemo/Resources/TestVideo.mp4" videoGravity="resizeAspectFill" showsPlaybackControls="false" isLooping="true" volume="0.0"/>
</body>

Screenshot


Video with Playback controlled by a Toggle

This example demonstrates how to control video playback using a toggle switch.

<body>
    <vstack spacing="20">
        <videoview src="url:https://shaffex.com/MagicUiDemo/Resources/TestVideo.mp4" videoGravity="resizeAspect" isPlaying="$playVideo" isLooping="false"/>
        <toggle key="playVideo" value="true">Play Video</toggle>
    </vstack>
</body>

Screenshot