-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Exit fullscreen when on ExitVR() #2264
Conversation
if (!this.is('vr-mode')) { return Promise.resolve(); } | ||
if (checkHeadsetConnected() || this.isMobile) { | ||
return this.effect.exitPresent().then(exitVRSuccess, exitVRFailure); | ||
} | ||
exitVRSuccess(); | ||
function exitFullscreen () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could move this down to where the enter fullscreen function is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure!
@@ -184,11 +184,21 @@ module.exports = registerElement('a-scene', { | |||
exitVR: { | |||
value: function () { | |||
var self = this; | |||
exitFullscreen(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should call this after the not-in-VR check below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it won't work. Just entering fullscreen does not set the state to vr-mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
r+wc |
5eb5df7
to
2827e46
Compare
Right now if we call
scene.exitVR()
it will just go back to the standard state if we are on VR but not if we're just in fullscreen mode. This PR introduces a call toexitFullScreen
on theexitVR
function.