-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Document how to enter/exit VR #1473
Comments
Nice section here, but for some reason waiting for <script>
(function () {
// switch to stereoscopic mode directly on page load, this needs to be after the a-scene loads.
var scene = document.querySelector('a-scene');
if (scene.hasLoaded) {
scene.enterVR();
} else {
scene.addEventListener('loaded', function () {
setTimeout(function () {
scene.enterVR();
}, 1000);
});
};
})();
</script> Also, not exactly specific to this issue, but still think we should support #705. |
Well, no one is against #705. Though I might also just recommend creating a scene component. They have the advantage that you don't have to worry about query selecting, waiting for events. Just write JS and attach: AFRAME.registerComponent('auto-enter-vr', {
init: function () {
this.el.sceneEl.enterVR();
}
}); <a-scene auto-enter-vr> |
like it |
Though I guess you might still have to add the event listener...but at least you don't have to query selector or worry whether it's already loaded. And you get reusable code for free. |
This is not working with version >=0.3.0 |
Are you testing in Chromium or Firefox Nightly? Chromium currently has a temporary user-gesture requirement; Firefox Nightly does not. |
(Accidentally closed issue.) |
I have tested in firefox & chrome in Android. It is not working. When I change the afrmae version to 0.2.0, it is directly going to vr mode. |
The following code seems to work with v0.4.0 in Firefox Nightly when
Note that I changed the component name since the original name collides with an internal component in v0.4.0. The |
|
Is there any way for None of the "old" methods of calling a script of setting a |
@Silver-Seagull yep, there is - I'm working on it right now. out of curiosity, are you working with only Cardboard? or are you using Chromium/Firefox w/ Vive/Rift? I'm just curious which platforms A-Frame devs are using. |
@cvan Do you have an ETA, or a hint? I'm sorta stuck and it's driving me bonkers. Our main platform will be cardboard and cardboard-like devices. Vive and Rift aren't really on the map for now :) |
@Silver-Seagull there are a couple bugs in that code. I'm fixing them right now. but if you're trying to do it right now, just set |
Just for the record. |
sorry about the bugs :-/ |
@cvan not sure |
we will presumably still want the |
@Silver-Seagull try: |
@cvan & @machenmusik Thank you for the help and tips - however the app isn't entering the split-view as it should. I feel a little out of my depth (to say the least) and I may have posted out of turn. Looking at our code, I think the view is not Cardboard, but an a-frame page in a Cordova app using the Crosswalk browser. I assume the WebKit-based browser is why this is not working? :edit: |
I got this patch working to auto-enter VR, but I still have to fix up the tests (and write new ones). As Diego mentions above, the code in A-Frame (and three.js) is going to have to be reimplemented soon anyway (to support all the variations in Oculus Carmel, Google Daydream, Google Cardboard, Firefox Nightly, and Chromium Desktop), as the WebVR API's navigation flow (for auto-entering VR) is in flux right now (see issues immersive-web/webxr#30 and immersive-web/webxr#152). @Silver-Seagull: I'd recommend dropping this JS snippet into your scene for now: window.addEventListener('load', function () {
var scene = document.querySelector('a-scene');
if (scene.hasLoaded) {
scene.enterVR();
} else {
el.addEventListener('loaded', function () {
scene.enterVR();
});
}
}); Hope that gets you where you need to be. |
@cvan It looks like it's a WebVR block, as browsers (save Carmel?) won't allow that sort of action unless it comes from a human. Thank you for the help and suggestions - hopefully |
Added hud ui prototype. Renders a curved panel 180˚ around the user. The panel could hold UI elements, info or other content. Toggle functionality is triggered by the select button on the game pad. handleGamepadButtonDown in CanvasContainer handles gamepad button event determines game pad button type based on passed event parameter e.detail.index Bug: trying to add toggle VR-mode functionality triggered by the gamepad start button event, but getting error from a-frame: scene.enterVR() can only be invoked by a user-gesture. aframevr/aframe#1473
Hi all. Has this been fixed? I see that in the link docs we have the requirements:
How would one listen to window.addEventListener('vrdisplayactivate', function () {
var scene = document.querySelector('a-scene');
scene.enterVR();
console.log(scene);
} |
aframe has vrdisplayactivate automatic. entervr/exitvr methods documented |
We should make it clear that the VR experience is only seamless on Vive et al. We are not managing our user's expectations correctly, see aframevr#1473
Unsatisfactory. Aframe makes very bold claims, on the frontpage of the site, that it
When in fact We should manage our users expectations correctly. Here is an example of the update I would like to see: |
This is now documented thank you, guys! 8f94626 |
Hello every one...
In Chrome for iOS (77.0.8685.103) works fine, but in Android, same Chrome version, do not works... anybody has a solution?, or maybe an explanation? Thanks in advance |
Halloween was last week, I'm not into zombie threads this week 😆 @fmagrosoto I don't think this is the right place to ask this question. Try the aframe discord, or if you think it's a bug, open your own issue. Good luck! |
Description:
And also document how to when
<iframe>
-ing content.The text was updated successfully, but these errors were encountered: