You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating a page where one can see which features of immersive sessions are available. Does this already exist somewhere? I would prefer to link to it.
I'm trying to cycle through creating an immersive-ar and immersive-vr session with one session feature each time, as listed in the MDN docs. If the session creation is successful, the feature is supported. Is there a more straightforward way of achieving this?
I'm trying to use Promises and async-await, which works well in the simulator. However, on the Meta Quest 3 device I own, whenever any promise seems to be involved with requestSession, it just hangs and never returns. I wanted to document this here in case anyone else runs into this behavior. Please redirect me anywhere else if there is a more appropriate place to ask this question.
Context: I'm working on p5.xr, and I think it's a little tricky ATM for people to be able to query what capabilities their devices have
Here is a snippet I tried to wrap, which never returns either a session or an error:
functionrequestSessionPromise(mode,feature){returnnewPromise((resolve,reject)=>{if(!navigator.xr){reject(newError('navigator.xr non existent'));}navigator.xr.requestSession(mode,{requiredFeatures: [feature]}).then((session)=>{resolve(session);},(error)=>{reject(error);},);});}
The text was updated successfully, but these errors were encountered:
I think you can make a single request with all features as optionalFueatures array, and then check a session's enabledFeatures list of what is supported.
Thanks for the feedback! I was looking for a way to test features on the current device, the way that was suggested by @Maksims works best for that. Although if the whole session fails to start for some reason, there is no meaningful info, so I also added buttons for each mode - session feature combination as a fallback.
The support table is also a valuable resource, thank you @AdaRoseCannon
After refactoring for not using Promises, I found that I was getting a Security error relating to not starting an XRSession from a user event. I was trying to start the next one from the end event of the previous one. Weird that it failed silently with promises.
I'm creating a page where one can see which features of immersive sessions are available. Does this already exist somewhere? I would prefer to link to it.
I'm trying to cycle through creating an
immersive-ar
andimmersive-vr
session with one session feature each time, as listed in the MDN docs. If the session creation is successful, the feature is supported. Is there a more straightforward way of achieving this?I'm trying to use Promises and async-await, which works well in the simulator. However, on the Meta Quest 3 device I own, whenever any promise seems to be involved with
requestSession,
it just hangs and never returns. I wanted to document this here in case anyone else runs into this behavior. Please redirect me anywhere else if there is a more appropriate place to ask this question.Context: I'm working on p5.xr, and I think it's a little tricky ATM for people to be able to query what capabilities their devices have
Here is a snippet I tried to wrap, which never returns either a session or an error:
The text was updated successfully, but these errors were encountered: