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

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

Open
AYTSistemas13 opened this issue Jul 5, 2023 · 7 comments · May be fixed by #303
Open

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

AYTSistemas13 opened this issue Jul 5, 2023 · 7 comments · May be fixed by #303

Comments

@AYTSistemas13
Copy link

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?

@dendrofen
Copy link

same for me.

@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Oct 29, 2023

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 (mrdoob/three.js#26452), but AR shouldn't normally depend on that.

@dendrofen
Copy link

dendrofen commented Oct 29, 2023

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'
     ] }}
/>

@CodyJasonBennett
Copy link
Member

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

@dendrofen
Copy link

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
Copy link

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

image

@CodyJasonBennett CodyJasonBennett linked a pull request Nov 20, 2023 that will close this issue
@MuhammadAakash
Copy link

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.

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

Successfully merging a pull request may close this issue.

4 participants