Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0.0][Chrome m79] Gyro not working - device orientation not taken into account #4355

Closed
MK-LucidWeb opened this issue Dec 16, 2019 · 8 comments

Comments

@MK-LucidWeb
Copy link
Contributor

MK-LucidWeb commented Dec 16, 2019

Description:

Device orientation is not taken into account anymore in non-VR mode (aka magic window).

Works on Chrome m78, breaks in m79.

Tested on

  • Pixel 2 (Android 10) with Chrome m78.0
  • Pixel 2 (Android 10) with Chrome m79.0
  • FRD-L09 (Android 7) with Chrome m78.0
  • FRD-L09 (Android 7) with Chrome m79.0
  • Samsung S7 (Android 8) with Chrome m78.0
  • Samsung S7 (Android 8) with Chrome m79.0

Logging the deviceorientation event produces correct result.

document.addEventListener('deviceorientation', console.log);
@dmarcos
Copy link
Member

dmarcos commented Dec 16, 2019

Any errors on console?

@MK-LucidWeb
Copy link
Contributor Author

MK-LucidWeb commented Dec 16, 2019

Any errors on console?

image

aframe.io-1576520442513.log

Unfortunately, nothing about that...

A quick search for deviceorientation in the repo yields nothing, is ThreeJS handling everything? Maybe it's worth a repro with ThreeJS.

Going back to previous commits doesn't solve the issue.

@MK-LucidWeb MK-LucidWeb changed the title [1.0.0] Gyro not working - device orientation not taken into account [1.0.0][Chrome m79] Gyro not working - device orientation not taken into account Dec 16, 2019
@MK-LucidWeb
Copy link
Contributor Author

For comparison, https://threejs.org/examples/misc_controls_deviceorientation.html works in Chrome m79.

@MK-LucidWeb
Copy link
Contributor Author

MK-LucidWeb commented Dec 17, 2019

Orientation used to be handled by webvr-polyfill but we don't use it anymore in Chrome m79? That's why it's not working in Chrome m79 but works fine in other browsers.

Fixing it on our side, already got a working build but we still need to do testing, PR will be submitted tomorrow.

@dmarcos
Copy link
Member

dmarcos commented Dec 17, 2019

Magic window tracking is also using the Polyfill and only enabled when WebXR is not available. After Chrome m79, ARCore devices come with WebXR enabled so we have to make sure the Polyfill also kicks in that case.

@manitito
Copy link

If you disable flag "WebXR Device API" m79 - then gyro is working

@MK-LucidWeb
Copy link
Contributor Author

MK-LucidWeb commented Dec 18, 2019

If you disable flag "WebXR Device API" m79 - then gyro is working

It works if you disable WebXR because then it uses the polyfill. It's not a proper fix though as you just can't ask all end users to disable the WebXR API. It's also counter productive as the goal is to support the actual WebXR spec.

@dmarcos dmarcos added this to the 1.0.1 milestone Dec 18, 2019
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 19, 2019
… DeviceOrientationControls without the DeviceOrientationEvent.requestPermission logic that is handled by A-Frame (fix aframevr#4355)

Co-authored-by: MK <maxence@lucidweb.io>
Co-authored-by: Diego Marcos <diego.marcos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants