Sanjeev
Sanjeev

Reputation: 211

Set default viewer for VrVideoView in Google VR SDK

I am using Google VR SDK's VrVideoView control to play mono 360 videos in my app. When I click on the Cardboard icon to use with an unofficial Cardboard viewer, the default viewer is set to the Google's Cardboard viewer. If I wanted to change this to work with a specific unofficial one, I need to install the separate Google Cardboard app on Android.

Is there a way to change the default viewer on VrVideoView without requiring the user of my app to download the separate Cardboard app? I have the URL to the viewer profile of the official Cardboard when registered from: https://vr.google.com/cardboard/viewerprofilegenerator/

Upvotes: 1

Views: 1111

Answers (1)

Sanjeev
Sanjeev

Reputation: 211

On Android, it seems that when the user scans a QR code for a new VR viewer using Google Cardboard app, a new folder is created on the root phone memory called 'Cardboard' with 'current_device_params' file under it. This file contains the viewer's parameters registered from 'https://vr.google.com/cardboard/viewerprofilegenerator/'. The app gets the file somehow from the url encoded in the QR code.

To set your VR viewer as the default viewer, your app has to create the 'Cardboard' folder and put the 'current_device_params' file for your viewer under it. To capture the parameters file for your viewer, just scan your viewer's QR code in Google Cardboard app and make a copy of the 'current_device_params' file under 'Cardboard' folder.

This method is not a documented way. If anyone else has info on the formal way, please post an answer. Could someone also check that this method works for iOS?

Upvotes: 1

Related Questions