Gita Assets
Unity / Assets

Unity Video Player WebGL 1.9 Browser Web Video Player | Video Player WebGL

Overview

This asset works in a similar fashion as the official VideoPlayer component, but for WebGL only. If you are having issues playing videos with the standard video player on Safari or other browser(s), this plugin is a simple and reliable way to play videos in Web builds. It is fully compatible with Safari and easy to integrate. It plays videos with spatial audio, especially useful for VR, plays m3u8 live stream videos, and plays videos with transparency. 20 events are available, while the official video player only supports 8. It supports playing videos locally or from an external URL, including any kind of Blob URL, URLs created with createObjectURL in general, and DataURL.

Key features

Play, pause, stop, restart, seek, change the volume, the playback rate, mute, check the length, width, height, whether it is playing, whether it is paused, check the current time, check the buffer, check the network state, preserve pitch or not, check the readiness state of the video, and check the time ranges the user can seek to;
Supports all available video events for the web: 20 events are available, the official Unity API only supports 8;
Everything can be easily configured through the inspector, and anything can also be changed later at runtime, for example changing the source of the video to play multiple content using the same video instance;
The video can autoplay;
Videos can be played from the StreamingAssets folder (local) or from an external URL, easily configurable through the inspector;
Spatial audio: downmix to mono and control the panning, for VR;
HLS (.m3u8 files) support by integrating a third party library;
Videos with transparency: a shader to play green screen videos, and a shadergraph to play side-by-side alpha masked videos;
The video feed is stored on a render texture, which is used to create materials applied to objects, for example playing the video on a plane, a sphere, or a raw image;
Works on all major browsers: Chrome, Safari, Firefox, Edge, Opera.

Compatibility

Unity 2019.4.41f2: Built-in, URP and HDRP are all supported. It works with any pipeline, but the example scene was made with the built-in one. It works with Unity 2019 or higher. Currently just not working on Firefox for Android, because of a Firefox bug. The version sold by this store is not stated in the official documentation; actual support is determined by the version sold by this store.

Requirements

Install the NaughtyAttributes free asset first; Unity 2019 or higher; use mp4 files encoded with H.264 or MPEG-4 for cross-browser compatibility (at the time of writing, webm is not supported on Safari yet); if a video source is an external URL, it must be a direct link pointing to the video, that is, the URL must end with the file name; it works on videos stored in CDNs like AWS or CloudFlare, but it does not support playing videos from YouTube because the URLs from YouTube videos are not direct links.

Render pipeline compatibility

UnityBuilt-inURPHDRP
2019.4.41f2

Technical specifications

Original creator
Marks
Current official version
1.9
Supported engines
2019.4.41, 2019.4.41f2
Render pipelines
2019.4.41f2 · Built-in / HDRP / URP
Official file size
1.09 MB
Official update date
2025-11-24
Asset file count
25
Package format
unitypackage
First official release
2021-04-02

Tags

Full description

This asset works in a similar fashion as the official VideoPlayer component, but for WebGL only. If you are having issues playing videos with the standard video player on Safari or other browser(s), you came to the right place! HIGHLIGHTS Play videos with spatial audio, especially useful for VR! Play m3u8 live stream videos! Play videos with transparency! 20 events available, official video player only supports 8. On par with Unity's video player speed, and in many circumstances, it is faster and plays smoothly while the official player lags. Supports playing videos locally or from external URL, including any kind of Blob URL, URLs created with createObjectURL in general, and DataURL! What are the features? You can play, pause, stop, restart, seek, change the volume, the playback rate, mute, check the length, width, height, if it’s playing, if it’s paused, check the current time, check the buffer, check the network state, preserve pitch or not, check readiness state of video, check the time ranges the user can seek to. It supports all available video events for the web. There are 20 events available, the official Unity API only supports 8. You can easily configure everything through the inspector. You can also change anything later at runtime if you want to. For example, changing the source of the video to play multiple content using the same video instance. You can autoplay the video. You can play videos from the StreamingAssets folder(local) or from an external URL. Easily configurable through the inspector. It works on basically anything. You can play the video on a plane or a sphere for example. You can play the video on a raw image. My asset works by storing the video feed on a render texture, which you then use to create materials that you apply to your objects. It works on all major browsers: chrome, safari, firefox, edge, opera. Currently just not working on firefox for Android, because of a firefox bug. NEW IN 1.6 You can downmix to mono, and control the panning. Check out the compatibility table for these features. You can now create spatial audio for VR! NEW IN 1.73 HLS (.m3u8 files) support by integrating a third party library with my plugin. More info in the docs. NEW IN 1.8 Added a shader that allows one to play green screen videos, and a shadergraph that allows one to play side-by-side alpha masked videos. There are a few important remarks about the latter: 1-If you use the built-in RP, it only works on Unity 2021.2 or higher. Otherwise, it requires you to use URP. 2- You must prepare the video, so that one of the sides has the color channels, and the other side has the alpha channel only. As a consequence, the prepared video will have twice the width or height of the original video, and might need to be compressed. 3- In the video preparation, it must be encoded as an h.264 mp4 file. EDITOR SUPPORT Please note that it doesn't work in the editor, like any WebGL jslib plugin. Making it work in the editor would require using the default video player, which I don't recommend doing. It's a case of comparing apples to oranges. While having the video in the editor is convenient, it doesn't reflect the web environment, which can lead to unexpected behaviour. Don't do it. Any requirements? Install the NaughtyAttributes free asset first. It works on Unity 2019 or higher. Use mp4 files encoded with H.264 or MPEG-4 for cross-browser compatibility. At the time of writing, webm isn’t supported on Safari yet. If your video’s source is an external URL, it must be a direct link pointing to the video, that is, the URL must end with the file name. It works on videos stored in CDNs like AWS or CloudFlare for example. But it does not support playing videos from youtube because the URL from youtube videos are not direct links. It works with any pipeline, but the example scene was made with the built-in one. It works with Unity 2019 or higher, and requires the NaughtyAttributes free asset.

Ratings and reviews

You can rate and review this item after purchase.

No buyer reviews yet.

Unity Video Player WebGL 1.9 Browser Web Video Player | Video Player WebGL · Unity Assets · Preview 3Unity Video Player WebGL 1.9 Browser Web Video Player | Video Player WebGL · Unity Assets · Preview 4Unity Video Player WebGL 1.9 Browser Web Video Player | Video Player WebGL · Unity Assets · Preview 5
Contact support