Open AR session without click on button

Hi
I have a problem with opening ar session without user interaction. Normally after creating defaultXRExperience I get button which turning on AR session after user click it, but I want to get this action done without user interaction. I need to open AR session exactly after creating all necessery function for defaultXRExperience.

Is there any possible way to do that?

I tried to make that working with using this code

var button = document.getElementsByClassName("babylonVRicon")[0];
button.click();

I’m not sure if this would be allowed in the OpenXR spec, but I’ll tag @RaananW to confirm (please be patient as he’s on vacation)

1 Like

Like automatically playing video none muted, the web does not allow opening a XR session without a user interaction.

1 Like

I can only confirm that - there are (among others) a few security implications to starting an AR session without the user’s consent. You require a user interaction to start a session.

Ok, so thanks for confirm that information.

1 Like