# Video

Video feature helps not only to enable pre-recorded web videos, but also live streams to improve the user engagement. To get started prepare a GameObject with a VideoView and GuidComponent.

<figure><img src="/files/Exp1wyvBYufMm189LFmr" alt=""><figcaption></figcaption></figure>

Then, create an empty GameObject under it and name it "Thumbnail Image View".

<figure><img src="/files/2gzA9M19OMXO5CKuh0sK" alt=""><figcaption></figcaption></figure>

&#x20;Attatch an ImageView, GuidComponent, and a NetworkImage.&#x20;

<figure><img src="/files/28SWAxM62gRjRCaRStRY" alt=""><figcaption></figcaption></figure>

The value (string) is the url of the video.

Assign this object into VideoView's Image View property field.&#x20;

<figure><img src="/files/ViWkSh6zOHOSoLLOSN9d" alt=""><figcaption></figcaption></figure>

Here the Video feature has a bit more than other features in terms of variables. For this reason, a table below is provided to explain the important variables:

<table><thead><tr><th width="225">Variable Name</th><th>Description</th></tr></thead><tbody><tr><td>Value</td><td>It can be any mp4 or m3u8 source. Others are supported, but we are not aware of performance and compatibility of this. The m3u8 sources are usually live stream sources</td></tr><tr><td>Thumbnail Behavior</td><td>Currently only 4 behaviors are supported: None, Download, Custom, and Generate.<br><br><strong>None:</strong> On start the mesh renderer where a video is supposed to be will have the initial texture, then after watching a video it turn black<br><br><strong>Download:</strong> Video player on start and on stop will try to fetch a jpg image at the same path with the name and just different extension to use it as thumbnail. For example, if video path is https://cdn.holofair.net/demo.mp4 then it will try to download https://cdn.holofair.net/demo.jpg. It also means you will be required to prepare or upload jpg image with the video.<br><br><strong>Custom:</strong> The video player on start and on stop will make use of Image feature, which customization must be configured like described in the page about <a href="/pages/ArqjVEhICHiX7HMsp3Kv">Images</a>.<br><br><strong>Generate:</strong></td></tr><tr><td>Is Full Screen On Play</td><td>Whether the video should open full screen whenever user tries to watch it.</td></tr><tr><td>Loading Visual (optional)</td><td>Assign a gameObject that will represent that video is loading</td></tr><tr><td>ImageModel (optional)</td><td>Assign here an Image feature gameObject that will be responsible for assigning a thumbnail whenever video is not watched by a user</td></tr></tbody></table>

VideoView has a few function that you'll need:

<table><thead><tr><th width="200">Function</th><th>Functionality</th></tr></thead><tbody><tr><td>Play</td><td>Starts playing the video.</td></tr><tr><td>Stop</td><td>Stops the video.</td></tr><tr><td>Toggle</td><td>Toggles between Play state and Stop state.</td></tr><tr><td>SetFullScreen</td><td>Enable or disable fullscreen view of the video. (Should be called while the video is playing)</td></tr><tr><td>RefreshThumbnail</td><td>Reapplies the thumbnail to the MeshRenderer the video was being played on. (This is automatically called after the video stops)</td></tr></tbody></table>

<figure><img src="/files/YLHbWHGkA1N9fUoR4Ip1" alt=""><figcaption><p>Watching a video in HoloFair</p></figcaption></figure>


---

# 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://docs.holofair.app/development/features/video.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.
