Bug 1511416 -Screen sharing preview pops up in Camera permission prompt . r=johannh

Differential Revision: https://phabricator.services.mozilla.com/D21976

--HG--
extra : moz-landing-system : lando
This commit is contained in:
akshitha 2019-03-18 12:12:29 +00:00
parent 0bcec64436
commit 3f1d5459d1

View File

@ -496,10 +496,9 @@ function prompt(aBrowser, aRequest) {
let doc = this.browser.ownerDocument;
// Clean-up video streams of screensharing previews.
if ((aTopic == "dismissed" || aTopic == "removed") &&
requestTypes.includes("Screen")) {
if (((aTopic == "dismissed" || aTopic == "removed") &&
requestTypes.includes("Screen")) || !(requestTypes.includes("Screen"))) {
let video = doc.getElementById("webRTC-previewVideo");
video.deviceId = undefined;
if (video.stream) {
video.stream.getTracks().forEach(t => t.stop());
video.stream = null;