Direct Video Android for Unity
Direct Video Unity docs
Loading...
Searching...
No Matches
Direct Video Android for Unity Scripting Documentation

Use the Direct Video Android package to play video files on Android devices such as smartphones and standalone VR headsets.

Key features:

  • Hardware-accelerated video decoding which reduces CPU usage to approx 60% of Unity's built-in VideoPlayer.
  • Seamless looping - videos loop without audio gaps or pauses.
  • Automatic fallback to lower resolution or lower frame-rate videos on lower-end devices based on maximum sizes supported by device hardware decoders. This means you can play e.g. 8K 360 video at 60fps on high end devices, and fall-back to 4k 30fps on lower-end devices without any scripting work.
  • On non-Android platforms (and in the Unity editor), the plugin can fall back to using Unity's built-in VideoPlayer component. This means you can test in-editor without having to have different components on your GameObjects.

Using the Plugin

The DirectVideoAndroid::DirectVideoPlayer component is used to play video files to a RenderTexture. You can then assign this texture to a material as usual. The initial size of the RenderTexture is ignored, as it is resized to the video dimensions when a frame is received.

If you want to script the DirectVideoPlayer component, see the api documentation for DirectVideoAndroid::DirectVideoPlayer.

If you just want to add one to a GameObject in the Unity editor, see the main documentation page: User docs.