# Example 6 - Video Player

![](/files/-MFjGyWGBsjt_F5Rd5D7)

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.)

![](/files/-MG2ONj_7e9sHPIvC-SU)

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>\
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.

![](/files/-MG2Qd47il3FLwhnF2AC)

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.

\ <br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://profpivec.gitbook.io/documentation-and-tutorials/game-creator/action-pack-2/examples/example-6-video-player.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
