MozillaReality / FirefoxReality

INACTIVE - A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://mzl.la/reality
Mozilla Public License 2.0
768 stars 217 forks source link

[Babylon.js] The app freezes or is exited when entering/exiting immersive mode in one exemple after another or in multiple windows #3725

Closed Softvision-RemusDranca closed 2 months ago

Softvision-RemusDranca commented 4 years ago

[Affected Versions]:

[Affected Platforms]:

[Prerequisites]:

[Steps to reproduce]:

  1. Navigate to https://doc.babylonjs.com/how_to/webxr_demos_and_examples.
  2. Open one example after another and play them in immersive mode.
  3. Observe the behavior.

[Expected results]:

[Actual results]:

[Notes]:

AleixCat commented 2 years ago

Hi @Softvision-RemusDranca, Recently I found a similar issue and with some researching I found a solution to make it work.

As far as I know, Firefox Reality uses a deprecated version of WebVR, now called WebXR and Babylon in their examples uses XR functionalities that block you from entering the scene in VR mode. Until the new version of WebXR is not implemented to Firefox reality, you can force Babylon to use WebVR by typing this line of code when creating the VR setup in the playground examples.

var vrHelper = scene.createDefaultVRExperience({createDeviceOrientationCamera:false, useXR: false});

Basically, you have to turn off useXR property. Maybe some functionalities it won't work as intended but at least you can enter in immersive mode.

Here our actual working example, I'ts a 360 HLS live video viewer: https://www.babylonjs-playground.com/#9FSDC7#173