From 0c213564d33e4a3a518d7e2d502bc3980f6769ed Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Thu, 25 Oct 2012 20:14:47 -0400 Subject: [PATCH] Bug 802397: Work around JS engine bug 449811 to select correct mic/camera r=dolske --- browser/modules/webrtcUI.jsm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/modules/webrtcUI.jsm b/browser/modules/webrtcUI.jsm index 9b172f593ea9..19ef9c9a20f3 100644 --- a/browser/modules/webrtcUI.jsm +++ b/browser/modules/webrtcUI.jsm @@ -90,6 +90,8 @@ function prompt(aBrowser, aCallID, aAudioRequested, aVideoRequested, aDevices) { if (selectableDevices.length > 1) { let selectableDeviceNumber = 0; for (let device of selectableDevices) { + // See bug 449811 for why we do this + let actual_device = device; selectableDeviceNumber++; secondaryActions.push({ label: stringBundle.getFormattedString( @@ -99,7 +101,7 @@ function prompt(aBrowser, aCallID, aAudioRequested, aVideoRequested, aDevices) { [ device.name ]), accessKey: selectableDeviceNumber, callback: function () { - Services.obs.notifyObservers(device, "getUserMedia:response:allow", aCallID); + Services.obs.notifyObservers(actual_device, "getUserMedia:response:allow", aCallID); } }); }