Video

Enable web video or livestreams with custom thumbnail for your users

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.

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

Attatch an ImageView, GuidComponent, and a NetworkImage.

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

Assign this object into VideoView's Image View property field.

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:

Variable NameDescription

Value

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

Thumbnail Behavior

Currently only 4 behaviors are supported: None, Download, Custom, and Generate. None: 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 Download: 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. Custom: 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 Images. Generate:

Is Full Screen On Play

Whether the video should open full screen whenever user tries to watch it.

Loading Visual (optional)

Assign a gameObject that will represent that video is loading

ImageModel (optional)

Assign here an Image feature gameObject that will be responsible for assigning a thumbnail whenever video is not watched by a user

VideoView has a few function that you'll need:

FunctionFunctionality

Play

Starts playing the video.

Stop

Stops the video.

Toggle

Toggles between Play state and Stop state.

SetFullScreen

Enable or disable fullscreen view of the video. (Should be called while the video is playing)

RefreshThumbnail

Reapplies the thumbnail to the MeshRenderer the video was being played on. (This is automatically called after the video stops)

Last updated