# Example 6 - Video Player

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MFjGwmSloXH5Cc4kNSv%2F-MFjGyWGBsjt_F5Rd5D7%2FActionPack2screen1.png?alt=media\&token=cc93868a-3935-45e9-985e-f4aa4d0b4438)

This Example sets up a remote video to play on three screens. The following instrcuctions will guide you through the set up of doing this in your scene.

1. Create a Primitive in your scene; Cube, sphere, plane. For the example we have used Plane so you can see the Video, otherwise it wraps it around the object. You may also need to rotate the object so the video is the correct way around.
2. Add an onStart trigger. To this trigger, add an Action and add the Action, Place Video on Object. This links the Video to that Game Object. (We make this a two step process for when there are multiple videos in the scene.)

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MG2M83HCRRLCQ-mBGFx%2F-MG2ONj_7e9sHPIvC-SU%2Fclip1.png?alt=media\&token=999c7a9c-6efb-4933-91e8-c77e609e38c0)

The Video can be local (must be in your project folder and in a resource folder if you want it included in your build), or remote streaming (must be a fully qualified address). You can use the clip shown above for a test. Also note that Unity only supports certain formats on certain devices. [https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html](https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html)\
I often use .ogg files as this is native to Unity, but .mp4 and .mov work great.

{% hint style="danger" %}
Note:  **YouTube is NOT a video format.**
{% endhint %}

3\. Add a trigger to your scene to play the Video. This could be onkeydown on onplayerenter, or whatever is required. Add an Action to this trigger to play the video.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MG2PelAwhCcm65rqj5x%2F-MG2Qd47il3FLwhnF2AC%2Fclip2.png?alt=media\&token=45f5099f-0b09-462d-8c97-102c1dbc9c4f)



Here you must add the Object (primitive with Video) again, in this case it is on Plane. This is done this way for multiple videos. Make whatever adjustments you want for start frame, looping, and Audio..

4\. You can also add trigger/Action to stop or pause the video. If you pause it, then trigger play again, it will continue. If you stop and trigger play, it will start again.

5\. You can also remove the video from the Object, and it is highly recommended to do this before you add it again or add another to the same object.

\
\
