# Media player

> Plays a video asset or an open stream URL (MP4, WebM; HLS where the browser plays it natively) as one video stream with play, loop and rate controls.

Source: https://docs.tune.toys/nodes/media.player/

Media player plays a video file or an open stream as one video stream, with play, loop, rate and seek controls.

## What it does

Set `data.asset` to a declared video asset id, or `data.source` to an open URL. Neither is required: without either the player waits for the host to choose media. HLS plays only where the browser plays it natively; DASH is not supported. Playback is paced by the media and the newest frame wins.

## When to use it

Use it for clips, backgrounds and prerecorded sources that you want to filter or composite with other streams.

## Ports

<!-- ports:start -->

| Port    | Direction | Signal | Lanes |
| ------- | --------- | ------ | ----- |
| `video` | Output    | Video  | 1     |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter | Label   | Range     | Default | Unit | Scale  | Notes                                                             |
| --------- | ------- | --------- | ------- | ---- | ------ | ----------------------------------------------------------------- |
| `playing` | Playing | 0 to 1    | 1       |      | linear | Play or pause the media. Choices: 0 Paused, 1 Playing.            |
| `loop`    | Loop    | 0 to 1    | 1       |      | linear | Start again at the end. Choices: 0 Once, 1 Loop.                  |
| `rate`    | Rate    | 0.25 to 4 | 1       | ×    | log    | Playback speed.                                                   |
| `seek`    | Seek    | 0 to 1    | 0       |      | linear | Jump to this fraction of the duration whenever the value changes. |

<!-- parameters:end -->

<!-- data:start -->

- `asset`: text.
- `source`: text.

<!-- data:end -->

### Playing (`playing`)

Plays when on and pauses when off.

### Loop (`loop`)

Starts again from the beginning at the end when on.

### Rate (`rate`)

Playback speed from 0.25 to 4 times; 1 is normal. It is logarithmic.

### Seek (`seek`)

Position in the media from 0 (start) to 1 (end).

## Tips

- Prefer a declared asset for Toys you share; an open URL needs network access.
- Video needs the browser's WebGPU video engine. The Player and exports do not run video yet and report it unavailable. To see a video output, bind a live Screen in the Frame to it.

## See also

[Image](https://docs.tune.toys/nodes/video.image/), [Camera](https://docs.tune.toys/nodes/video.camera/), [Screen capture](https://docs.tune.toys/nodes/video.display/), [Video](https://docs.tune.toys/concepts/video/), [Control lanes](https://docs.tune.toys/concepts/control-lanes/).
