Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Use unsupported video files in the Editor

Use video files in your application that aren't supported by the Editor.
Read time 1 minuteLast updated 4 days ago

  1. Drag your video file into the StreamingAssets folder.
  2. Reference the StreamingAssets URL in the Video Player component. Alternatively, you can use
    Application.streamingAssetsPath
    .

Use placeholder video files

If you want to use placeholder versions of your video files that are compatible with your Editor but use a different version for your target platform, you can include both versions in your project and decide which version to use at runtime.
The following example script demonstrates how to use different video URLs for different platforms. For more information, refer to Platform-dependent compilation.
void SetupMovieFile(VideoPlayer vp){ #if UNITY_EDITOR || UNITY_LINUX vp.url = pathToMyVp8File; #elif UNITY_ANDROID vp.url = pathToMyVp9File; #elif UNITY_STANDALONE_WIN vp.url = pathToMyWmvFile; #else vp.url = pathToMyMp4File; #endif}
This ensures Unity uses the correct video format at runtime, while allowing placeholder files in the Editor.

Additional resources