Search code examples
androidionic-frameworkaframewebvr

Android devices: rendering black when entering VR mode in A-Frame


When clicking the "Enter VR" icon (the goggle icon), to enter in VR mode, the screen periodically turns black. The issue seems to occur at random times.

We have tried using both A-Frame version 0.3.0 and 0.3.2., but with no difference in behavior.

Whether it fails (renders black or is successful) I recieve the following errors:

aframe.min.js:281 Uncaught TypeError: Cannot read property 'length' of undefined
at r (aframe.min.js:281)
at M.fireVRDisplayPresentChange_ (aframe.min.js:58)
at HTMLDivElement.s (aframe.min.js:58)

aframe.min.js:149 Uncaught (in promise) DOMException: 
A call to screen.orientation.lock() or 
screen.orientation.unlock() canceled this call.

index.html#/lobby:1 Uncaught (in promise)     
DOMException: screen.orientation.lock() is not available on this device.

The issue seems to vary in occourance depending on device.

Tested on: Samsung Galaxy S6/S6 Edge Nexus 6x One plus 3

Does anyone have any information regarding this issue and hopefully a fix?


Solution

  • The workaround we ended up with was altering the aframe when using mobile android devices, to make it believe it was using a samsung VR device. Seemingly some of the functionality hasn't been implemented for android devices in AFrame, which is why we went with this solution.