Use the Video Player component to play videos (from a URL or video clips) on various surfaces in your sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary.
The Video Player component lets you play video content on different targets, which changes where the video content displays in your scene. To change the video’s target, open the Video Player component and set the Render Mode property to your preferred target.
This page provides details about some of the video targets available:
For more details of the Render Mode property and its options, refer to the Render mode dropdown.
For information about all of the Video Player component’s settings, refer to Video Player component reference. For instructions on how to create the component, refer to Create a Video Player component.
Unity determines the default target when you create the component. If you drop a Video Clip or Video Player component onto a GameObject, the texture of the GameObject’s Renderer becomes the target.
If you drag the Video Clip into the scene, the target is set to the far plane of the scene’s main camera. Otherwise, the VideoPlayer uses the Render Texture render mode.
You can choose to project the video onto the near plane or far plane of the CameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary. To enable this setting, set Render Mode to Camera Near Plane or Camera Far Plane.
The near plane shows the video in front of any objects in the scene. Displaying the video on this plane is useful for video cutscenes or UI elements that need to overlay the scene.
The far plane shows the video in the background of the scene, which is ideal for animated backgrounds.
You can use the Video Player component to attach video files to GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary, and play the video’s content on the GameObject’s TextureAn image used when rendering a GameObject, Sprite, or UI element. Textures are often applied to the surface of a mesh to give it visual detail. More info
See in Glossary at runtime.
When you attach a Video Player component to a GameObject that contains a Renderer component, Unity automatically sets the Material Property of the component to the GameObject’s main Texture.
The following screenshot shows a Video Player component attached to a spherical GameObject. The GameObject has a MeshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary Renderer component, so the Video Player automatically assigns it to the Renderer field, which means the video clip plays on the Mesh RendererA mesh component that takes the geometry from the Mesh Filter and renders it at the position defined by the object’s Transform component. More info
See in Glossary’s Texture.
You can use the Video Player to display video content on a Render Texture. This is useful if you want to project your video onto multiple GameObjects or to apply post-processingA process that improves product visuals by applying filters and effects before the image appears on screen. You can use post-processing effects to simulate physical camera and film properties, for example Bloom and Depth of Field. More info post processing, postprocessing, postprocess
See in Glossary effects to the content. For instructions on how to set up and optimize a Render Texture for video, refer to Set up your Render Texture to display video.
When you set Render Mode to API Only, the Video Player component doesn’t automatically assign a target or draw the video content anywhere. Instead, this mode expects you to handle video rendering manually through C# code. Use scripting to access the video frames via the VideoPlayer.texture
property.
This render mode provides the video as a Render Texture or Texture object, which you can dynamically assign to texture fields in your scene through code. This approach is useful because it eliminates the need to create and manage an intermediate Render Texture manually.
With API Only, you can use video content anywhere the Unity API allows you to assign a texture, such as on Raw Image UI elements, or GameObject materials.