Add support for offerSession#5410
Conversation
| } else { | ||
| if (!utils.device.checkVRSupport()) { this.enterVREl.classList.add('fullscreen'); } | ||
| this.enterVREl.classList.remove(HIDDEN_CLASS); | ||
| sceneEl.enterVR(false, true); |
There was a problem hiding this comment.
We should probably handle this a bit differently. Give control to the dev and decide if the page is auto-entering VR. Maybe a property in this component enterImmersiveModeAtPageLoad a tad long but descriptive. open to a shorter alternative. We can then probably handled the sceneEl.enterVR here https://github.com/aframevr/aframe/pull/5410/files#diff-8eae4e9d86bc7d08e7db133212411b40a655722a0d8c42c1c99c45fccef72f74L124 before deciding to display the UI
ddf1906 to
a03d112
Compare
| self.xrSession = xrSession; | ||
|
|
||
| if (useOfferSession) { | ||
| self.usedOfferSession = false; |
There was a problem hiding this comment.
Probably can always set this to false here?
There was a problem hiding this comment.
without checking useOfferSession
There was a problem hiding this comment.
I believe the regular requestSession API will then also set this to false. At that point we'll be in a bad state because the offersession promise is still pending.
b378d9e to
e44bd2b
Compare
offerSessionis a recent addition to WebXR that makes it more obvious that a page can enter WebXR.Quest browser got feedback that the "Enter VR/AR/XR" buttons on a lot of sites is hard to find.
Often the button is small or scrolled of the bottom of the page. To remedy this, we worked with the W3C Immersive group on a new API that adds a button to the URL bar. This button will launch a pending immersive session.
This change will call
offerSessionwhen the page is opened or when the immersive session exits.cc @dmarcos