Show a screen when in VR but holding the phone in portrait mode
Description:
- A-Frame Version: 0.5.0
- Platform / Device: Any device where that has no dedicated display for VR
- Reproducible Code Snippet or URL: -
I am trying to get a message to show when a user has its mobile phone in VR mode but holds it inin portrait position.
I see that there is some code in aframe/src/components/scene/vr-mode-ui.js:136 to do this.
Unfortunately, it is never triggered, because when entering VR the scene locks the phone in landscape mode (aframe/src/core/scene/a-scene.js:246)
Are there any plans to make this feature available again by not locking the orientation of the phone ? I believe it would be better from a UX perspective.
This should work:
Let us know if you have more details.
I have done further research and I think I understand now, I'll share its results here in case it helps some fellow developers.
The browser on which I want this feature to work is Chrome for Android. With a vanilla version of the browser, I am able to reproduce the bug as shown here :

But there is a caveat. When the WebVR flag (in chrome://flags) is enabled, the WebVR viewer changes :
- When the flag is turned off, a bespoke viewer is used

- When the flag is turned on, the Cardboard Viewer is used

The Cardboard Viewer will end up being the default one, and its behaviour cannot be changed via HTML code. So this feature cannot be implemented on it. It might be interesting to implement it on the "bespoke" viewer, though.
@ngokevin any thoughts on the above ?