Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | function onOK() { |
michael@0 | 6 | window.arguments[0].out = { |
michael@0 | 7 | video: document.getElementById("video").selectedItem.value, |
michael@0 | 8 | audio: document.getElementById("audio").selectedItem.value |
michael@0 | 9 | }; |
michael@0 | 10 | |
michael@0 | 11 | return true; |
michael@0 | 12 | } |
michael@0 | 13 | |
michael@0 | 14 | function onLoad() { |
michael@0 | 15 | let videoDevices = window.arguments[0].videoDevices; |
michael@0 | 16 | if (videoDevices.length) { |
michael@0 | 17 | let videoMenu = document.getElementById("video"); |
michael@0 | 18 | for (let i = 0; i < videoDevices.length; i++) { |
michael@0 | 19 | videoMenu.appendItem(videoDevices[i].name, i); |
michael@0 | 20 | } |
michael@0 | 21 | videoMenu.selectedIndex = 1; |
michael@0 | 22 | } else { |
michael@0 | 23 | document.getElementById("videoGroup").hidden = true; |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | let audioDevices = window.arguments[0].audioDevices; |
michael@0 | 27 | if (audioDevices.length) { |
michael@0 | 28 | let audioMenu = document.getElementById("audio"); |
michael@0 | 29 | for (let i = 0; i < audioDevices.length; i++) { |
michael@0 | 30 | audioMenu.appendItem(audioDevices[i].name, i); |
michael@0 | 31 | } |
michael@0 | 32 | audioMenu.selectedIndex = 1; |
michael@0 | 33 | } else { |
michael@0 | 34 | document.getElementById("audioGroup").hidden = true; |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | window.sizeToContent(); |
michael@0 | 38 | } |