Reflex Logo
Docs Logo
Library

/

Media

/

Video

The video component can display a video given an src path as an argument. This could either be a local path from the assets folder or an external link.

If we had a local file in the assets folder named test.mp4 we could set url="/test.mp4" to view the video.

API Reference

rx.video

Video component share with audio component.

PropType | ValuesDefault
src
Union[str, list, list]
-
playing
bool
-
loop
bool
-
controls
bool
-
light
bool
-
volume
float
-
muted
bool
-
config
Dict[str, Any]
-
disable_remote_playback
bool
-

Event Triggers

See the full list of default event triggers
TriggerDescription
on_readyCalled when media is loaded and ready to play. If playing is set to true, media will play immediately.
on_startCalled when media starts playing.
on_playCalled when playing is set to true.
on_playingCalled when media starts or resumes playing after pausing or buffering.
on_progressCalled while the video is loading only. Contains played and loaded progress as a fraction, and playedSeconds and loadedSeconds in seconds. eg { played: 0.12, playedSeconds: 11.3, loaded: 0.34, loadedSeconds: 16.7 }.
on_time_updateCalled when the media's current time changes (~4Hz, use .throttle to limit calls to backend).
on_duration_changeCallback containing duration of the media, in seconds.
on_pauseCalled when media is paused.
on_waitingCalled when media starts buffering.
on_seekingCalled when the media is seeking.
on_seekedCalled when media seeks with seconds parameter.
on_rate_changeCalled when playback rate of the player changed. Only supported by YouTube, Vimeo (if enabled), Wistia, and file paths.
on_endedCalled when media finishes playing. Does not fire when loop is set to true.
on_errorCalled when an error occurs whilst attempting to play media.
on_click_previewCalled when user clicks the light mode preview.
on_enter_picture_in_pictureCalled when picture-in-picture mode is enabled.
on_leave_picture_in_pictureCalled when picture-in-picture mode is disabled.
Built with Reflex