Playing Video from OBB File

I have a Google Play project where the APK size was over 100MB. I had to take the video content out of the APK and put into a split OBB file to get under the size limit. The OBB file wraps a couple MP4 video files and I zipped with 7-zip as a ZIP with STORAGE compression. To play the video, I used a VideoView with the [CustomAPEZProvider] to play video directly from the downloaded OBB file.

Samsung Gear VR Demo

The Samsung Gear VR connects with my Samsung Note 5. First thing I’ll put it in network adb mode so I can deploy from Unity to the phone wirelessly with it inside the Gear VR.

I have some devices already connected, so disconnect those and kill any wireless connections.

adb kill-server

Connect the Note 5 from micro-usb to the desktop computer. The device should show in the adb device list.

C:\Users\tgraupmann>adb devices
List of devices attached
0915f9e3930b3504 device

Now put the device in wireless mode.

C:\Users\tgraupmann>adb tcpip 5555
restarting in TCP mode port: 5555

Connect to my phone now that it’s in wireless mode. The IP address can be found under the wireless settings.

C:\Users\tgraupmann>adb connect 192.168.2.241
connected to 192.168.2.241:5555

And now Unity can deploy to the phone wirelessly.

Now create a new Unity project in the release version (5.3.3).

Set the platform to `Android` in build settings.

Set a bundle identifier in the `Android` other settings.

At this point `File->Build and Run` launches and runs on the `Note 5`.

Download [Oculus Utilities for Unity 5 SDK Examples] and unzip to a new folder. (This is the same download that I used for `Oculus Rift DK1`).

Copy the project settings into the Unity project settings (OculusUtilities_SDKExamples_0_1_3_0_beta\ProjectSettings).

Import the Oculus Unity Package (OculusUtilities_SDKExamples_0_1_3_0_beta\SDKExamples.unityPackage).

Restart Unity and reopen the project.

Be sure to put the [Oculus Signature File] into `Assets\Plugins\Android\assets`.

Open the sample scene (Assets\Scenes\FirstPerson_Sample.unity) and add it to the build list.

Let the baking process complete before hitting `File->Build and Run`.

GearVRFirstPersonDemo
GearVRFirstPersonDemo

There are white debug line appearing which can be disabled on the `DebugControls` GameObject by disabling the `OVR Debug Graph`.

GearVRFirstPersonDemo2
GearVRFirstPersonDemo2

If your pair a bluetooth controller (like the OUYA Controller), you can move around the scene with the left stick and look horizontally with the right stick.

And then I hooked up some zombies, of course, with [Setup For Fuse CC]. I’m getting some visual artifacting maybe caused by the near/far clip planes. This wasn’t happening with the `Oculus Rift DK1` on the same scene.

GearVRFirstPersonDemo3
GearVRFirstPersonDemo3

It’s not the near/far clip planes on the camera. The artifacts are happening on the terrain and on cubes on the sunny side.

GearVRFirstPersonDemo4
GearVRFirstPersonDemo4

The same issue persists even using the `Mobile/Diffuse` shader.

GearVRFirstPersonDemo5
GearVRFirstPersonDemo5

Logged the issue on the [Unity Forums].

I needed to change the light from a directional light to a baked area light.

GearVRFirstPersonDemo6
GearVRFirstPersonDemo6

Tweaking the Point light to mixed mode reproduces the lighting more closely with the desktop version.

GearVRFirstPersonDemo7
GearVRFirstPersonDemo7

I used Type: Point, Baking: Mixed, Draw Halo: true, and Range: 395.7.

GearVRFirstPersonDemo8
GearVRFirstPersonDemo8