Lesson 86 +10 XP

Video Player & Media

Video Player & Media

Unity can play movie files and dynamic video streams within your game worlds or UI layouts.

The Video Player Component

The Video Player component handles video file decoding and playback:

  • Source:
  • Video Clip: Plays an imported video file (e.g. .mp4, .mov) stored inside the project assets.
  • URL: Streams a video file from a web server link.
  • Play on Awake: Starts video playback as soon as the object loads.
  • Loop: Restarts playback when the video ends.

Rendering Destinations

You can output video to several targets:

  • Camera Near/Far Plane: Renders the video as a background or foreground layer on a camera.
  • Render Texture: Renders the video to a texture asset. You can then apply this texture to any 3D model (like a TV screen mesh or movie theater screen plane) or raw UI image.
  • Material override: Directly paints the movie onto a specific material property.

Audio Output

  • Direct: Plays video sound directly through system speakers.
  • AudioSource: Routes video audio tracks to an AudioSource component, allowing the sound to be spatialized in 3D or run through Audio Mixer groups.

TL;DR

  • Use the Video Player component to play movie files or online URL streams.
  • Render videos to Render Textures to display them on 3D meshes like TVs.
  • Route video audio to AudioSources to spatialize the sound in 3D space.
  • Keep video compression profiles optimized for target devices.