0
votes

I'm currently trying to build a small vr app using the react-vr framework. On my desktop PC in Chrome, I get the "Enter VR Mode" Button to toggle from 360 degree view to real VR mode after enabling the WebVR option via chrome://flags.

Now I want to make an Android App of my application using cordova. Ich have a ZTE Axon 7 Smartphone, which is Google Daydream ready. But when I open the cordova App on my Phone, I didnt`t get the Enter VR Mode button, only the 360 degree Web view appears. On the mobile Chrome I also activated the WebVR option, But I'm not sure if this option also affects the cordova container.

What I'm not totally familiar with is how cordova works on the smartphone. I think it uses the system defaults web view (which should be chrome on android?), but is the web view really equal to the chrome browser (and it's settings)? So if I enable WebVR on my mobile chrome, is this option even available in my cordova app or do I also need to enable it in the web view (and how can I do this)?

At the end this is all I need: Access to WebVR API in the cordova container to get the "Enter VR mode" button. Any idea on how to achieve this?

From the reactVR docs: "Access to VR headsets is provided through the Web VR API, which enables display on the Rift, GearVR or other devices." (see React VR)

UPDATE: I tried to open the react-vr-app on my smart phone directly in the mobile browser (Chrome and Canary) via ADB Reverse and everything works fine - I get the "enter vr mode" button and it even switches the mode! So my problem must be located in cordova (and the missing WebVR support in the web view?)

UPDATE2: I added the WebVr Polyfill to my Cordova project and now the app is shown in real VR mode, even in the cordova container. It is a possible workaround, but the polyfill only supports simple cardboards and in my perfect environment I want to use the Google Daydream controller as well. So a real implementation of the WebVR API in Cordova is still needed.

1

1 Answers

0
votes

You could try and change the target of your cordova app to target Chrome Canary.

There is a post around this here: How to change default browser of cordova browser platform?

Canary is the only mobile browser I have seen work with react-vr and a daydream HMD. Canary will also need the web-vr flags enabled.