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

webXR button does not switch to third state when fullscreen VR is exited using the controller #29457

Closed
andrewhodel opened this issue Sep 20, 2024 · 11 comments
Labels
Milestone

Comments

@andrewhodel
Copy link

andrewhodel commented Sep 20, 2024

Description

The webXR button does not switch states when fullscreen VR is exited using the controller.

If you click the XR button to start fullscreen, then exit fullscreen by pressing a button on the controller the button still says enter while the standard nomenclature of the Oculus browser says resume in the browser placed button near the address bar.

Reproduction steps

  1. View a WebXR example with a VRButton using a VR headset and controller.
  2. Start fullscreen by clicking the VRButton.
  3. Exit fullscreen, the button is still in the "start state".

Code

NA

Live example

Screenshots

No response

Version

168

Device

Headset

Browser

No response

OS

No response

@andrewhodel
Copy link
Author

andrewhodel commented Sep 21, 2024

This is confusion with the 2nd resume button placed by the browser near the address bar and the VR fullscreen running in the background with one button saying resume and one button saying enter.

There should be a standard word of all VR buttons and Oculus used resume meaning there should be a 3rd state of this button.

@andrewhodel andrewhodel changed the title webXR button does not switch states when fullscreen VR is exited using the controller webXR button does not switch to third state when fullscreen VR is exited using the controller Sep 21, 2024
@Mugen87 Mugen87 added the WebXR label Sep 22, 2024
@mrxz
Copy link
Contributor

mrxz commented Sep 23, 2024

I don't see the behaviour you describe. Before the session starts the button reads "Start XR" (or "Enter VR" for VRButton) and once the session has started shows "Stop XR" (or "Exit VR"). These are the only two states that are relevant for the button.

The Meta Quest Browser does show a "Resume" and "Quit" button near the address bar when showing the webpage while the immersive session is ongoing. At that point however the XRButton shows "Stop XR" which aligns with the 'Quit' action.

Before/after immersive session During immersive session
image image

What would the third state be?

Also, it's not possible to programmatically do what the 'Resume' button does AFAIK. Not to mention that it wouldn't make sense on PCVR or handheld AR.

@andrewhodel
Copy link
Author

andrewhodel commented Sep 25, 2024

@mrxz

I don't see the behaviour you describe. Before the session starts the button reads "Start XR" (or "Enter VR" for VRButton) and once the session has started shows "Stop XR" (or "Exit VR"). These are the only two states that are relevant for the button.

The Meta Quest Browser does show a "Resume" and "Quit" button near the address bar when showing the webpage while the immersive session is ongoing. At that point however the XRButton shows "Stop XR" which aligns with the 'Quit' action.

Before/after immersive session During immersive session
image image
What would the third state be?

Also, it's not possible to programmatically do what the 'Resume' button does AFAIK. Not to mention that it wouldn't make sense on PCVR or handheld AR.

Resume is the third state and it is in your 2nd screenshot. It is a third state because your browser shows 3 buttons (Enter, Resume, and Quit). The VRButton only shows 2 buttons (Enter VR, Exit VR).

@mrxz
Copy link
Contributor

mrxz commented Sep 25, 2024

@andrewhodel

Resume is the third state and it is in your 2nd screenshot. It is a third state because your browser shows 3 buttons (Enter, Resume, and Quit). The VRButton only shows 2 buttons (Enter VR, Exit VR).

Ah, but 'resume' isn't a state, it's an action. The button only cares about the two states of there being an immersive session or not. It already shows the relevant action to transition between these two states.

In any case, it's not possible to implement this "resume" action. And, like I mentioned, won't even make sense for PCVR or handheld AR. Even if it would be possible, I'm not sure it should be included in the VR/XRButton.

@Mugen87 Mugen87 closed this as completed Sep 25, 2024
@Mugen87 Mugen87 added this to the r169 milestone Sep 25, 2024
@andrewhodel
Copy link
Author

@mrxz a button's state is the text it displays that describe the action it performs.

@Mugen87 this should not be closed.

@andrewhodel
Copy link
Author

@mrxz the enter action is described as resume when there is an existing immersive session.

The button should say resume as the browser button does when there is an existing immersive session and the action that it invokes when clicked is the same as the enter action.

@andrewhodel
Copy link
Author

@mrxz @Mugen87 why would you want the VRButton to have different wording than the Browser VR buttons?

@mrxz
Copy link
Contributor

mrxz commented Sep 26, 2024

The button should say resume as the browser button does when there is an existing immersive session and the action that it invokes when clicked is the same as the enter action.

You haven't addressed any of the concerns. The 'Resume' button does something that you can't do programmatically. If it would do the "same as the enter action" it would request a new immersive session when there is already an active session. As per the WebXR spec, this will give an error.

Feel free to verify this behaviour yourself.

why would you want the VRButton to have different wording than the Browser VR buttons?

There are many different WebXR capable user agents, so it's infeasible to try and match the wording used by each one of these. The current wording seem clear enough to me, and if users want to customize it, they can easily make their own version of the button.

If you feel strongly about this feature, you should try and get WebXR spec expanded so that implementing the resume action becomes possible. Until then, there's literally nothing that can be done on the Three.js side.

@andrewhodel
Copy link
Author

@mrxz the buttons having different action names than the browser has is not normal.

@andrewhodel
Copy link
Author

@mrxz @mrdoob Closing this is incorrect.

@donmccurdy
Copy link
Collaborator

Matching the wording and behavior of the Meta Quest Browser — let alone every possible WebXR-compatible browser — is neither a goal of the 200-line XRButton.js example, nor possible with the WebXR API, as @mrxz has explained above.

@andrewhodel Please be respectful of the time and energy of others: continued argument and @-pings in a closed thread are unhelpful. I would recommend that you create a button customized to your wording needs, if you prefer a different behavior.

Repository owner locked as resolved and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants