Video Player component
Add videos to your GameObject with a Video Player component.
Read time 1 minuteLast updated 4 hours ago
Use the Video Player component to display video content from a file or from the web directly on the surface of an object. The following are example objects you can display video on in your scene:
- TV screens
- Mobile phones and tablets
- Cinemas and theatre screens
- Digital billboards and jumbotron screens
- Security camera feeds
- Car infotainment screens
- Monitors
Supported video file formats
Unity Studio lets you import the following video file formats:.mp4.m4v.mov.mpg.mpeg.webm.ogv
Add a Video Player component to your scene
To add videos to your scene:- Create an object you want to display the video on.
- Select the object in the Hierarchy panel to open the Inspector panel.
- Select Add Component > VideoPlayer.
- Set Source to Video Asset or URL, then assign a video file or URL to the new property that becomes available.
Video Player component's properties
The following properties are available for you to customize in the Video Player component: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:
|