From 9ae0592a367330918bb1766c7e956d992c9d1173 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Wed, 20 Feb 2013 17:08:44 -0500 Subject: [PATCH] Bug 843190: Allow cameras/mics to be shared if permissions UI is disabled r=derf --- dom/media/MediaManager.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index b370f91cc4e..dd7ca00bf08 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -613,14 +613,18 @@ public: return NS_ERROR_FAILURE; } + /** + * We're allowing multiple tabs to access the same camera for parity + * with Chrome. See bug 811757 for some of the issues surrounding + * this decision. To disallow, we'd filter by IsAvailable() as we used + * to. + */ // Pick the first available device. for (uint32_t i = 0; i < count; i++) { nsRefPtr vSource = videoSources[i]; - if (vSource->IsAvailable()) { - found = true; - mVideoDevice = new MediaDevice(videoSources[i]); - break; - } + found = true; + mVideoDevice = new MediaDevice(videoSources[i]); + break; } if (!found) { @@ -647,11 +651,9 @@ public: for (uint32_t i = 0; i < count; i++) { nsRefPtr aSource = audioSources[i]; - if (aSource->IsAvailable()) { - found = true; - mAudioDevice = new MediaDevice(audioSources[i]); - break; - } + found = true; + mAudioDevice = new MediaDevice(audioSources[i]); + break; } if (!found) {