WebXR freezes after getUserMedia
Reported by
vlim...@gmail.com,
Oct 19
|
||||||
Issue descriptionUserAgent: 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:
,
Oct 19
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
,
Oct 19
,
Oct 22
Thanks for filing the issue..! As per comment#2, the issue seems to be related to Android OS, hence adding appropriate OS label.
,
Oct 22
Moving over to AR.
,
Oct 26
As per comment#2, as the issue is related to Android OS, hence removing OS Linux from it. Thanks!
,
Oct 30
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 Deleted