New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 896946 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug
Proj-VR
Proj-XR-AR
Proj-XR



Sign in to add a comment

WebXR freezes after getUserMedia

Reported by vlim...@gmail.com, Oct 19

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36

Steps to reproduce the problem:
This is also reproducible in [this googlecodelabs demo](https://googlecodelabs.github.io/ar-with-webxr/final/) with the following codes to be run in console sequentially.

```
// 0. Initialize vars
navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
var gumOption = {
  video: {
    facingMode: "environment",
    height: 480,
    width: 640,
  },
  audio:false
};

// 1. Initialize a function to end XR session
async function endXr () {
  // Cancel the current RAF
  app.session.cancelAnimationFrame(app.onXRFrame);

  // End the XR session
  await app.session.end();

  // Unbind the framebuffer to baseLayer's framebuffer
  app.gl.bindFramebuffer(app.gl.FRAMEBUFFER, null);

  // Remove the previously created canvas in 'onEnterAR()'
  var canvas = document.getElementsByTagName('canvas')[0];
  canvas.parentNode.removeChild(canvas);

  // Remove window's click bound event
  window.removeEventListener('click', app.onClick);

  // Revert frame buffer back to how it previously was.
  THREE.Object3D.prototype.onBeforeRender = () => {}
}

// 2. Stop XR session
endXr();

// 3. Run GUM
navigator.getUserMedia(gumOption, function(stream) {
    window.stream = stream;
    console.log(":: Got stream !!", stream);
  }, function(error) {
    console.error(":: Got error instead 8(", error);
  }
);

// 4. Stop GUM
stream.getTracks().forEach(stream => stream.stop());

// 5. To restart the XR
app.onEnterAR();
```

In the code above, I have provided my approach to end the XRSession (**1st**) and to restart it back up (**5th**). And if you follow those steps sequentially in [that googlecodelabs demo](https://googlecodelabs.github.io/ar-with-webxr/final/), you may notice that after the **5th** step, WebXR freezes and becomes unusable.

Now, this issue does not happen if I just end the XRSession and restart it back. But only happens if I include `getUserMedia` operation which is the **3rd** and **4th**.

Another thing is that if `gumOption.video.facingMode` is not provided, `getUserMedia` fails in the **3rd** step.

What is the expected behavior?
Re-entering WebXR should work

What went wrong?
WebXR freezes and becomes unusable after getUserMedia being used in the page.

Did this work before? No 

Does this work in other browsers? No
 WebXR freezes and becomes unusable after getUserMedia being used in the page.

Chrome version: 71.0.3574.0  Channel: dev
OS Version: 16.04
Flash Version:
 

Comment 1 Deleted

Sorry for the confusing description format and invalid OS.

This is happening in Android OS. Here's more detail about it.

Browser: Chrome Dev
UA: Mozilla/5.0 (Linux; Android 8.0.0; SM-G930F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3574.0 Mobile Safari/537.36
ARCore: Version 1.5.180910096
Labels: Needs-Triage-M70
Cc: swarnasree.mukkala@chromium.org
Labels: Triaged-ET OS-Android
Thanks for filing the issue..!

As per comment#2,  the issue seems to be related to Android OS, hence adding appropriate OS label.
Cc: lincolnfrog@chromium.org
Components: -Blink>WebXR Blink>WebXR>AR
Moving over to AR.
Labels: -OS-Linux
As per comment#2, as the issue is related to Android OS, hence removing OS Linux from it.

Thanks!
Status: Available (was: Unconfirmed)

Sign in to add a comment