aframe icon indicating copy to clipboard operation
aframe copied to clipboard

VR mode not working on iOS devices

Open tomasbrownnz opened this issue 3 years ago • 6 comments

Description:

  • A-Frame Version: 1.3.0
  • Platform / Device: iPhone 11 Pro - iOS 15.3.1 - Safari (latest)
  • Reproducible Code Snippet or URL: Link

A blank white screen is showing on mobile and tablets trying to access VR mode on personal projects and A-Frame examples. Image shows console logs that are being thrown when this issue is replicated.

image

tomasbrownnz avatar Mar 08 '22 22:03 tomasbrownnz

I also have this problem (blank screen when using A-FRAME VR mode in iphone). I see that previous version (e.g. 1.1.0) works partially, but I need to use it with the most recent version.

Thanks.

rsiqueira avatar Mar 11 '22 15:03 rsiqueira

same problem here http://quantumscans.de/gallery/loewe/loewe.html

Problem occurs on iPhone 11, IOS 15.3.1 with the newest Cardboard app installed in Safari, Firefox and Google Chrome (newest versions respectively). And other apple devices.

EricRorich avatar Mar 29 '22 10:03 EricRorich

AFRAME uses THREE.js WebXRManager or WebVRManager for VR. But as the XR is becoming more acceptable and defined on the browsers, VR is receiving less attention. IOS uses WebVRManager as navigator.xr is not available yet.

On the last AFRAME update (1.3.0) and THREE recent updates some functions became classes. This happened to EventDispatcher And also, some changes implemented for WebXRManager broke WebVRManager.

The first error is because EventDispatcher became a class and does not have enumerable methods anymore. Therefore, Object.assign between WebVRManager and EventDispatcher do not work.

To fix it, you can copy the EventDispatcher function from an older THREE version and replace it on aframe 1.3.0 . It looks something like this. image

Or you can replace/add this just after WebVRManager. image

For the other errors, this.render inside WebGLRenderer function was changed. Noting is being passed to the xr.getCamera function. This leads to the camera errors.

image

But, WebVRManager requires the camera on that function.

image

Adding the camera on this.render, fixes the problem. And, I believe this change does not break anything else, as WebXRManager does not use it.

image

@dmarcos is this something that can be officially added to allow CDN usage again?

shabarito avatar Aug 25 '22 01:08 shabarito

@shabarito If you figured out all the changes needed and you have it working, you probably should create a PR to have further discussion on it and have a chance for the changes to be merged.

vincentfretin avatar Aug 26 '22 09:08 vincentfretin

Thanks @vincentfretin. I am new to GIT. This was my first PR. I think I did everything correctly.

shabarito avatar Aug 26 '22 12:08 shabarito

Don't worry, we all did our first PR at one point. :) When you create a PR, it's nice to reference the issue. Here the PR you created is #5102

vincentfretin avatar Aug 26 '22 12:08 vincentfretin

This has been fixed in master by https://github.com/aframevr/aframe/pull/5102 Can reopen if necessary.

dmarcos avatar Nov 17 '22 21:11 dmarcos