- Home /
Stereo 360 video Pause/Play Not Working - Works with Mono Videos?
Hi,
I've got a project which contains several scenes. Each scene contains either a mono 360 video or a stereo 360 video.
When I'm creating the mono scenes I am able to pause and play using the space bar. I export it out, play the experience on the Oculus Rift and the video scenes all play and I can pause and play using the spacebar.
When I'm creating the stereo scenes I can't pause and play. However, the editor is recognizing that I am pausing and playing because inside of the inspector window underneath my script there is the word Pause and a checkbox. When I hit spacebar the checkbox is checked, when I hit it a second time the box is unchecked.
The only difference between my mono and stereo scenes is how the videos are displayed. For mono I am using a sphere which has the video player inside of it. For stereo I drag the video onto the hierarchy and apply the necessary textures in order to use the Skybox feature. The video does not pause.
I'm using a script called ChangeLevel inside of a game object called _Manager. This ChangeLevel script contains code that allows me to either skip to the next video, go back to the previous video, or pause/play. I have mapped all of these functions to both the keyboard and the Oculus Remote.
What is odd is that I can skip scenes in mono and stereo using both the controller and the Oculus Remote. The only thing I can't do is pause and play if the video in the scene is stereo or not inside of a sphere.
should also add that I am unable to pause using the Oculus remote within any instance. I can only pause if I'm inside of the mono video experience using spacebar on the keyboard.
Below is the scripts code:
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class ChangeLevel : MonoBehaviour
{
public bool paused;
void Start()
{
paused = false;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.RightArrow))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
if (Input.GetKeyDown(KeyCode.LeftArrow))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex - 1);
}
if (Input.GetKeyDown(KeyCode.Escape))
{
Application.Quit();
}
if (Input.GetKeyDown(KeyCode.Space))
{
paused = !paused;
}
if (paused)
{
Time.timeScale = 0;
}
else if (!paused)
{
Time.timeScale = 1;
}
OVRInput.Update(); // need to be called for checks below to work
if (OVRInput.GetDown(OVRInput.Button.DpadLeft))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex - 1);
Debug.Log("back", gameObject);
}
if (OVRInput.GetDown(OVRInput.Button.DpadRight))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
Debug.Log("next", gameObject);
}
if (OVRInput.GetDown(OVRInput.Button.Two))
{
Application.Quit();
Debug.Log("Hello", gameObject);
}
if (OVRInput.Get(OVRInput.Button.One))
{
print("round button pressed");
}
if (OVRInput.GetDown(OVRInput.Button.One))
{
paused = !paused;
}
if (paused)
{
Time.timeScale = 0;
}
else if (!paused)
{
Time.timeScale = 1;
}
}
}