Skybox video player - ImmersiveStorytelling/DocumentationMasterclass GitHub Wiki
This is the new and recommended way to play 360 video's in Unity. The main advantage over the HPV node is not having to convert the video's into the large hpv format. The main disadvantage is the lack of a 'play in reverse' button. So if it's necessary, you will need to reverse the video with a video editor of choice.
To add the videoPlayer in Unity following steps are needed:
- in the Unity gui
GameObject >> Video >> Video Player
. - create a Render texture
Assets >> Create >> Render Texture
. - set the size of this texture to the size of your video.
- create a new material
Assets >> Create >> Material
. - drag and drop the created render texture into the texture field of the newly created material.
- last you should assign this material as the skybox material
Window >> Lighting >> Settings
The shader of the Video material should be set to Skybox/panoramic
Now you can create a script attached to the camerarig. This script should have a public variable of the type VideoPlayer so you can drag the video player into it.
Inside this script you can now control the video player with the Unity Video Player scripting API
example the startVideo function
private void startVideo(int num)
{
vPlayer.url = "Assets/" + num.ToString() + ".MP4";
vPlayer.Play();
}