360 Video

This page will guide you through the steps to record your 360 video within Unity. It is assumed you are using the Video Player component in Unity 5.6 or newer. It is also assumed that your are playing a video on an inverted sphere mesh.

inverted sphere

Prepare Scene

Add a cognitiveVR manager to your scene. This can be found in cognitive3D->Add Cognitive Manager.

Click cognitive3D->Advanced Options.

Add a Dynamic Object component to the gameobject with your Video Player component.

  • Enable 'Use Custom Mesh'. The mesh name can be any name with ascii characters and no spaces. Press Export. This will be uploaded later
  • Enable Track Gaze on Dynamic Object
  • Enable Use Custom Id and set the Custom Id to 1000
  • Make sure the VideoPlayer field references the Video Player component
  • Set the ExternalVideoSource to a public url that Scene Explorer can load the video from. This will likely be the same url as the Video Player component source

dynamic object settings

Scene Export

Follow the normal export process through the cognitive3D->Scene Setup menu. The video sphere should have a Dynamic Object Component on it.

Code Reference

The setup above will provide basic information about how the user is watching the video. If you have controls like pause, rewind, stop, seek and playable speed, you may have to add additional code.

//skipping ahead 5 seconds
VideoPlayer.frame += (long)(5 * VideoPlayer.frameRate);

//add this


//changing videospeed
VideoPlayer.playbackSpeed = 2.0f;

//add this
GetComponent<CognitiveVR.DynamicObject>().SendVideoTime().SetProperty("videospeed", VideoPlayer.playbackSpeed);