Open asajeffrey opened 4 years ago
An alternative API is to add a sessionavailable
event, which the UA can fire at document load, which the UA uses to signal to the content that there is user intent to enter a session (https://immersive-web.github.io/webxr/#user-intention).
Using the API would look like (following the example in the proposal:
navigator.xr.addEventListener('sessionavailable', (evt) => {
navigator.xr.requestSession('immersive-vr').then((session) => { ... })
});
Note: the spec makes it possible for the permissions API to be used to request features mid-session. However I don't think anyone implements this yet?
Also some features, like layers and secondary views, must be requested at the beginning of the session.
The API proposal at https://github.com/immersive-web/navigation#api-proposal is a
sessiongranted
event that contains asession
field. This means that content has no way to control the initialization of the session, and in particular can't request feature (https://immersive-web.github.io/webxr/#feature-dependencies).