

Note: Certain web browsers allow you to manually disable browser CORS security for file:// URL access for local development and testing purposes. More info See in Glossary platform however, the Source must point to a web URL because playback from local filesystem and Application.persistentDataPath isn’t supported.

The Unity WebGL build option allows Unity to publish content as JavaScript programs which use HTML5 technologies and the WebGL rendering API to run Unity content in a web browser. On WebGL A JavaScript API that renders 2D and 3D graphics in a web browser. On native build platforms, setting Source to URL allows direct use of files in the filesystem, with or without a file:// prefix. The Source field in the Video Player component By default, the Source is set to Video Clip. Use the Source drop-down to set the video source to URL. Navigate to Assets > Import New Asset… to import a video file.Īfter the video file is imported, you can select the newly created Video Clip in the Video Player component window using the Select VideoClip option by clicking the circle button to the right of the video clip, or by dragging and dropping the Video Clip Asset into the corresponding Video Player component field. A Video Clip created by dragging and dropping a video file into the Project window

There are two ways to import a video file into Unity:ĭrag a video file and drop it into the Project window A window that shows the contents of your Assets folder (Project tab) More info See in Glossary to create a Video Clip. To create and use a Video Clip Asset, you must first import a video file. The Video Player component plays videos from a Video Clip Asset. The Video Player component plays content imported from a variety of sources, such as video clips, URLs, Asset Bundles, and from the Streaming Assets folder.
