Bug 802397: Work around JS engine bug 449811 to select correct mic/camera r=dolske

This commit is contained in:
Randell Jesup 2012-10-25 20:14:47 -04:00
parent 2546ad6ad0
commit 1f7c3d3c1e

View File

@ -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);
}
});
}