# External Video Player

You can use an External Video Player script to load a video from a URL and display it on an object. You can play videos from YouTube, and videos that you load through a direct URL to the file. For more information, refer to [Supported video file types](https://docs.engagevr.io/engage/essential-features/sharing-media/videos/supported-video-file-types) in the public documentation.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-05a38ed5109feb77b3f2ec00daac3ea55224dbce%2Fvideo_screens.jpg?alt=media" alt=""><figcaption><p>Example video playing on a cube and a plane</p></figcaption></figure>

## Basic setup

To set up an External Video Player script to display a 2D video on an object, complete the following steps:

1. Add a `Mesh Renderer` component to the object, if it doesn't have one already.
2. Add the `External Video Player` script to the object.
3. In the **External Video Player** script parameters, in the **Url** field, enter the URL for the video that you want to play.
4. Select the **Play On Enable No Sync** check box so that the video plays automatically when the location loads.
5. Expand the **Screen Renderers** list, and then select the plus button to create a new slot.
6. Drag the object from the **Hierarchy** panel to the **Screen Renderers** slot that you just added.

The video will begin to play when the location loads in ENGAGE. You can't test the video in Unity. For more information about the available parameters, see [#external-video-player-parameters](#external-video-player-parameters "mention").

## Correctly orientating a plane

If you use one of Unity's standard Plane 3D objects with an External Video Player script, and you want to ensure the correct orientation, change the coordinate system to Local, and rotate the plane so that the Z axis is pointing down and the X axis is pointing left as you face the screen.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-42884c31b6620442b2b4e55d9f11efeea89f6a25%2Fvideo_plane_orientation.jpg?alt=media" alt=""><figcaption><p>Correctly orientated plane shown in its local coordinate system</p></figcaption></figure>

## Playing a 360 video

You can display a 360 video on the interior surface of a sphere. Any user inside the sphere will then be able to look around and be immersed in the 360 video. The setup for a 360 video is slightly different to the basic setup.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-f2f203b958c8aeedf61bbeac72d682634c223f65%2Fvideo_360.jpg?alt=media" alt=""><figcaption><p>360 video displayed using the External Video Player script. Video is <a href="https://www.youtube.com/watch?v=eKumVFvGHFA">Underwater Life, Marsa Alam, Egypt. 360 video in 8K.</a> by AirPano VR</p></figcaption></figure>

To set up an External Video Player script to display a 360 video, complete the following steps:

1. Create an empty game object.
2. Add an `ENGAGE_360_Video_Photo_Sphere.FBX` model as a child of the game object. You can find the model in the `Assets` > `ENGAGE_CreatorSDK` > `Meshes` folder.
3. In the **Inspector** panel, set the **X** rotation of the `ENGAGE_360_Video_Photo_Sphere` model to `0`.
4. Add an `External Video Player` script to the parent game object.
5. In the **External Video Player** script settings in the **Inspector** panel, enter the URL for the video that you want to play in the **Url** field.
6. Select the **Play On Enable No Sync** check box so that the video plays automatically when the location loads.
7. Expand the **Screen Renderers** list, and then select the plus button to create a new slot.
8. Drag the `ENGAGE_360_Video_Photo_Sphere` object from the **Hierarchy** panel to the **Screen Renderers** slot that you just added.
9. Turn off the **Use Aspect Ratio Correction** check box.

The video will begin to play when the location loads in ENGAGE. You can't test the video in Unity. For more information about the available parameters, see [#external-video-player-parameters](#external-video-player-parameters "mention").

## External Video Player parameters

<table><thead><tr><th width="230">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>Url</td><td><strong>Required</strong><br><br>URL of the video to load.</td></tr><tr><td>Start Time Offset Seconds</td><td>Enter <code>0</code> to play the video from the start. Enter a value greater than <code>0</code> to begin playback at that point in the video.</td></tr><tr><td>Play On Enable No Sync</td><td><p><strong>Recommended</strong>: Select to begin playback of the video when the script is enabled. This typically occurs when the location loads.<br><br>When this parameter is turned on, the video plays independently for each user. The video begins to play when the object the script is attached to becomes active for the user. If you want to synchronize playback, you can use AFX or network states to synchronize activation of the object. However, there may still be slight differences between users, and users that join late will see the video play from the start.<br></p><p>When this parameter is turned off, the video will not play unless the video screen is uploaded to ENGAGE servers as an IFX, and ENGAGE staff apply additional configuration settings.</p><p><br><strong>Note</strong>: You can add screens that play synchronized video from an external URL in the Experience Editor. For more information, refer to <a href="https://docs.engagevr.io/engage/experience-editor/videos-and-screens/external-url-screens">External URL screens</a> in the public documentation.</p></td></tr><tr><td>Volume</td><td>The audio volume. Enter a value between <code>0</code> (muted) and <code>100</code> (maximum volume).</td></tr><tr><td>Is Loop</td><td>Select to restart the video when it ends.<br><br>If you clear this check box, videos loaded through a direct URL to the file will display the final frame of the video when they end.<br><br><strong>Note</strong>: This setting is not compatible with YouTube videos. When a YouTube video ends, it will display a view determined by YouTube. For example, the thumbnails for suggested videos to watch next.</td></tr><tr><td>Youtube Resolution</td><td>Deprecated</td></tr><tr><td>Is 3d</td><td>Select if the the video is 3D.</td></tr><tr><td>Screen Renderers</td><td>List of Mesh Renderers on which to display the video.</td></tr><tr><td>Screens 360</td><td>Not required to display 360 video. For more information, see <a data-mention href="#playing-a-360-video">#playing-a-360-video</a>.</td></tr><tr><td>Use Aspect Ratio Correction</td><td><strong>Important</strong>: Clear this option if you want to display a 360 video.<br><br>Select this option to force the video to a target aspect ratio.</td></tr><tr><td>Target Aspect Ratio</td><td>Enter a float representation of a target aspect ratio. To calculate the value, divide the target width by the target height.<br><br>For example, for a 16:9 aspect ratio, enter <code>1.7778</code>.</td></tr><tr><td>Use Chroma</td><td>Select to use chroma keying, where the background is made transparent based on its color.</td></tr><tr><td>Use Custom Chroma Key Color</td><td>Select to define a specific chroma key color. You can then choose a color in the <strong>Custom Chroma Key Color</strong> parameter.</td></tr><tr><td>Custom Chroma Key Color</td><td>The color to be used for chroma keying, which will become transparent in the video.</td></tr><tr><td>Spatial Audio Option ><br>Is Spatial Audio</td><td>Select to enable spatial audio, where the volume reduces as you get further away from the object.</td></tr><tr><td>Spatial Audio Option ><br>Spatial Audio Range</td><td>The maximum range from the object at which audio will be heard. Measured in Unity units.</td></tr><tr><td>Additional Audio Points</td><td>A list of transforms that define the centres of additional audio zones.<br><br>The audio from the video will be heard by a user when they're within the defined range of an audio point.</td></tr><tr><td>Canvas Renderers</td><td>Advanced feature. Contact ENGAGE for more information.</td></tr></tbody></table>
