react-xr icon indicating copy to clipboard operation
react-xr copied to clipboard

Click ARButton on Android and the camera don´t show up.

Open AYTSistemas13 opened this issue 1 year ago • 7 comments

When I click Enter AR on my phone the web page displays in all the screen but the camera don´t show up and in the browser appear the notification that my camera is in use. Also I tried the examples about webar in three.js site and here it works fine. My project it is in NEXT js, I have the emulator on my browser desktop and here works but on my phone doesn´t, it is omething about css styling?

AYTSistemas13 avatar Jul 05 '23 16:07 AYTSistemas13

same for me.

dendrofen avatar Oct 29 '23 12:10 dendrofen

Are you doing anything out of the ordinary in your rendering pipeline like post-processing or have texture use? Unless this is a trivial setup, I'd need to see an example. Note that camera-access currently corrupts three.js' texture state (https://github.com/mrdoob/three.js/issues/26452), but AR shouldn't normally depend on that.

CodyJasonBennett avatar Oct 29 '23 13:10 CodyJasonBennett

Okey, after some tests with android chrome, I have found out there are some warnings in debugger console. One of the warning messages - XR.js:200 Unrecognized feature requested: dom-overlay-for-handheld-ar

So I decided to append ARButton optionalFeatures with dom-overlay and this solution fix camera issue.

Following code fix issue for me:

<ARButton
     className="ar_button"
     sessionInit={{ optionalFeatures: [
          'local-floor', 
          'bounded-floor', 
          'hand-tracking', 
          'layers', 
          'dom-overlay'
     ] }}
/>

dendrofen avatar Oct 29 '23 15:10 dendrofen

Fixed how? Optional features shouldn't change behavior unless they're supported. Only required features will block a request.

CodyJasonBennett avatar Oct 29 '23 16:10 CodyJasonBennett

Well, without 'dom-overlay' feature pressing AR button leads to just fullscreen page, no AR camera, nothing just a fullscreen page. Adding 'dom-overlay' feature normalise AR button functional

dendrofen avatar Oct 29 '23 16:10 dendrofen

@CodyJasonBennett Need to mention, despite the fact my solution fix camera issue it's also generates new warnings...))

image

dendrofen avatar Oct 29 '23 16:10 dendrofen

Same here from my side as well. Without the dom-overlay clicking on the AR Button just leads to the Full page and not opens up Camera. And by adding dom-overlay clicking on the AR Button is working fine.

MuhammadAakash avatar Feb 14 '24 12:02 MuhammadAakash

dom overlay is now supported in 6.1 feel free to reopen if this issue reoccurs

bbohlender avatar Aug 01 '24 15:08 bbohlender