react-xr
react-xr copied to clipboard
Click ARButton on Android and the camera don´t show up.
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?
same for me.
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.
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'
] }}
/>
Fixed how? Optional features shouldn't change behavior unless they're supported. Only required features will block a request.
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
@CodyJasonBennett Need to mention, despite the fact my solution fix camera issue it's also generates new warnings...))
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.
dom overlay is now supported in 6.1 feel free to reopen if this issue reoccurs