The Unity Stereo180Video sample scene demonstrates how to play a stereo 180-degree video. This sample scene is primarily targeted at Mobile developers as the Rift functionality displayed in playing the video is rather simple.
After the sample scene has been set up and started, the user is presented with a brief video. On Rift, this video is playing on Unity’s video player. On Mobile platforms, it is running using ExoPlayer on an Android external surface using an OVROverlay layer, where it can take advantage of Asynchronous TimeWarp (ATW) for better efficiency.
The Stereo180Video sample scene demonstrates video playback for Oculus Go and Gear VR. This scene requires some special steps before it will work properly.
Assets/Oculus/SampleFramework/Usage/Stereo180Video/StreamingAssets to Assets/StreamingAssets.Assets/Oculus/SampleFramework/Usage/Stereo180Video/Plugins/Android/java/com/oculus/videoplayer/MyVideoPlayer.java.removeme to MyVideoPlayer.java.audio360 and audio360-exo28 plugins in Assets/Oculus/SampleFramework/Usage/Stereo180Video/Plugins/Android/Audio360/, make sure the Android checkbox is checked.Assets/Plugins/mainTemplate.gradle and look at the version number for com.android.tools.build:gradle. If the version number is 2.3.0, use the first list. If it is 3.2.0 or greater, skip to the second list. mainTemplate.gradle: buildscript {repositories { ... } }, add google().allprojects {repositories { ... } }, add google() and jcenter().dependencies { ... }, add compile 'com.google.android.exoplayer:exoplayer:2.8.4'.android { ... }, add sourceSets.main.java.srcDir "$projectDir/../../Assets/Oculus/SampleFramework/Usage/Stereo180Video/Plugins/Android/java". You should now be able to build and run the sample.mainTemplate.gradle: dependencies { ... }, add implementation 'com.google.android.exoplayer:exoplayer:2.8.4'.mainTemplate.gradle: android { ... }, add sourceSets.main.java.srcDir "$projectDir/../../Assets/Oculus/SampleFramework/Usage/Stereo180Video/Plugins/Android/java". You should now be able to build and run the sample.This section describes the key prefabs and Game Objects that make the core functionality of this scene work. For this scene, the following are covered:
This object contains the components and scripts necessary for playing 180-degree stereo videos. Key components are as follows:
OVR Overlay – Used as a surface on which ExoPlayer plays the video on Mobile platforms.
Of note is the Android-only Is External Surface check box. When checked, this allows for an Android external surface to be controlled by the Asynchronous TimeWarp (ATW) layer. In this sample, this allows the Android ExoPlayer video player surface to be run as an ATW layer, avoiding redundant texture copies to save memory and cycles.