> For AI agents: the complete documentation index is at [llms.txt](https://reflex.dev/docs/llms.txt). Markdown versions are available by appending `.md` or sending `Accept: text/markdown`.

---
components:
  - rx.video
---

# Video

```python exec
import reflex as rx
```

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.

```python demo
rx.video(src="https://www.youtube.com/embed/9bZkp7q19f0", width="400px", height="auto")
```

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

```md alert info
# How to let your user upload a video

To let a user upload a video to your app check out the [upload docs](/docs/library/forms/upload).
```

## API Reference

### rx.video

Video component share with audio component.

#### Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `src` | str, list[str], list[dict[str, str]] | - | The url of a video or song to play. |
| `playing` | bool | - | Set to true or false to pause or play the media. |
| `loop` | bool | - | Set to true or false to loop the media. |
| `controls` | bool | - | Set to true or false to display native player controls. |
| `light` | bool | - | Set to true to show just the video thumbnail, which loads the full player on click. |
| `volume` | float | - | Set the volume of the player, between 0 and 1. |
| `muted` | bool | - | Mutes the player. |
| `config` | dict[str, Any] | - | Player-specific configuration parameters. |
| `disable_remote_playback` | bool | - | Set to true to disable the default remote playback option on supported devices. |

#### Event Triggers

Base event triggers: https://reflex.dev/docs/api-reference/event-triggers/

Component-specific event triggers:

| Event Trigger | Description |
| --- | --- |
| `on_ready` | Called when media is loaded and ready to play. If playing is set to true, media will play immediately. |
| `on_start` | Called when media starts playing. |
| `on_play` | Called when playing is set to true. |
| `on_playing` | Called when media starts or resumes playing after pausing or buffering. |
| `on_progress` | Called 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_update` | Called when the media's current time changes (~4Hz, use .throttle to limit calls to backend). |
| `on_duration_change` | Callback containing duration of the media, in seconds. |
| `on_pause` | Called when media is paused. |
| `on_waiting` | Called when media starts buffering. |
| `on_seeking` | Called when the media is seeking. |
| `on_seeked` | Called when media seeks with seconds parameter. |
| `on_rate_change` | Called when playback rate of the player changed. Only supported by YouTube, Vimeo (if enabled), Wistia, and file paths. |
| `on_ended` | Called when media finishes playing. Does not fire when loop is set to true. |
| `on_error` | Called when an error occurs whilst attempting to play media. |
| `on_click_preview` | Called when user clicks the light mode preview. |
| `on_enter_picture_in_picture` | Called when picture-in-picture mode is enabled. |
| `on_leave_picture_in_picture` | Called when picture-in-picture mode is disabled. |
