Video
Enable web video or livestreams with custom thumbnail for your users
Last updated
Enable web video or livestreams with custom thumbnail for your users
Last updated
Video feature helps not only to enable pre-recorded web videos, but also live streams to improve the user engagement. As well as the other features it comes with Edit capabilites, to make the world more recycle for more than a single purpose or make your content more dynamic. To get started prepare a gameObject with following components:
And here is a closer look to the VideoModel and BasicVideoView:
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:
Apart from that, make sure to add ON THE SAME GAMEOBJECT NetworkImageMeshRenderer component and configure it according to how you want a video to be displayed on a MeshRenderer:
Now, how to actually allow user to watch a video? To achieve that, you need a trigger that does BasicVideoView.TogglePlay(). In this example, 2 triggers are used to allow user to start watching the video in 2 different ways: click on the collider or enter a trigger. See the images below:
Don't forget to Edit button to make sure you can replace the video in real-time:
See the video below to see how it works in HoloFair:
Variable Name | Description |
---|---|
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 3 behaviors are supported: None, Download and Custom. 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.
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