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 Name
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 then it will try to download 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:
Starts playing the video.
Stops the video.
Toggles between Play state and Stop state.
Enable or disable fullscreen view of the video. (Should be called while the video is playing)
Reapplies the thumbnail to the MeshRenderer the video was being played on. (This is automatically called after the video stops)
Watching a video in HoloFair
Last modified 3mo ago