Video
Add videos to your User Interface (UI) with a Video element.
Read time 2 minutesLast updated 4 hours ago
Use the Video element to display videos inside your User Interface (UI), which overlays the scene. This element lets you include video content from a file or from the web directly in your app. This can help you create informative apps or simulate in-world screens. For example, you can use the Video element to display:
- Instructional, training, and onboarding videos
- Cutscenes
- Splash screens and intros
- Video animations for UI interactions
Supported video file formats
Unity Studio lets you import the following video file formats:.mp4.m4v.mov.mpg.mpeg.webm.ogv
Add a Video UI element to your scene
To add videos to your UI, do one of the following:- In the Hierarchy panel, go to the top left and select Add (+) > UI > Video Player.
- Drag the Video Player object in the folder into the Hierarchy panel.
Built-in Assets
The Video UI element components
The Video element automatically contains the following components:Component | Description |
|---|---|
| UI Transform | Use to position, rotate, and resize the Video element in Edit mode. You can change the size, rotations, and positions in the following ways:
|
| Video Player | Renders the video in the UI according to your settings. |
| Raw Image | Visualize the size and position of the video and change its color. |
Video Player component properties
The following properties are available for you to customize in the Video element's Inspector panel:Property | Description |
|---|---|
| Source | Choose whether to play a video from a file or from a URL. The options are:
|
| Video Asset | Attach a video file to play. This setting only appears if you set Source to Video Asset. |
| URL | Enter a direct URL to a video file hosted online. The URL must point directly to the video and typically ends with the file extension, such as .mp4. This is useful if you don’t want to store large video files locally. This option is only available when Source is set to URL. |
| Play On Awake | Choose whether to start the video when the scene starts or wait until something else triggers the start (for example, use a Logic script to play the video.) |
| Loop | Enable to make the video play again when it reaches the end. Disable to play the video once. |
| Playback Speed | Choose the speed of the video. Range from 0 to 10. Set to |
| Volume | Change how loud the video's sound is. Set to 0 for no sound, and 1 for maximum volume. |
| Aspect Ratio | Control how the video fits into the UI Transform rectangle. You have the following options:
|
| Render Mode | Choose how the Video Player displays the video. The options are:
|
Raw Image component properties
Property | Description |
|---|---|
| Texture | Use this setting to visualize the position, rotation, and size of the video's image. Any texture you choose is ignored. |
| Color | Change the tint color to apply to the video. |
| Raycast Target | Determine whether the video can be detected by raycasts, such as mouse clicks or other UI interaction checks. |