sfeuerstein
sfeuerstein

Reputation: 913

Is there a way to hide the Google Cardboard SDK's transition view on iOS?

I am using the Cardboard SDK for iOS to display VR videos within an app, and I am trying to use a custom instruction view to tell the user to put their phone into the Cardboard viewer. As it stands right now no matter what I do the SDK's built in instructional transition view pops up on top of everything. In the Android SDK you can hide the transition view via the setTransitionViewEnabled(<BOOL>) method, but I can't find anything comparable on the iOS side. Has anyone been able to do this on iOS?

To add some more information, here is how I'm setting the video view up:

let videoView = GVRVideoView()
videoView.delegate = self
videoView.enableFullscreenButton = true
videoView.enableCardboardButton = true
videoView.enableTouchTracking = true

UIApplication.sharedApplication().statusBarHidden = true
let url = NSURL(fileURLWithPath: VRDownloadManager.shared.getFilePath(itemURL!))
videoView.loadFromUrl(url)
self.view.addSubview(videoView)
videoView.displayMode = .FullscreenVR
videoView.resume()

Upvotes: 0

Views: 825

Answers (1)

bnussey
bnussey

Reputation: 1964

On the iOS SDK there is a boolean property called hidesTransitionView which is defined as:

Hides the transition view when entering VR mode.

If you set this to true, it should work.

So the code would be:

let videoView = GVRVideoView()
videoView.delegate = self
videoView.enableFullscreenButton = true
videoView.enableCardboardButton = true
videoView.enableTouchTracking = true
videoView.hidesTransitionView = true

Reference: https://developers.google.com/vr/ios/reference/interface_g_v_r_widget_view.html#a4caa081eedcb807d5b5555d8b4f7b777

Upvotes: 0

Related Questions