mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1037408 - webrtcUI's activeStreams getter should be able to return lists for a specific device type, r=dolske.
This commit is contained in:
parent
522e7af0ea
commit
802e1cdb49
@ -23,7 +23,7 @@ let WebrtcIndicator = {
|
||||
|
||||
fillPopup: function (aPopup) {
|
||||
this._menuitemData = new WeakMap;
|
||||
for (let streamData of this.UIModule.activeStreams) {
|
||||
for (let streamData of this.UIModule.getActiveStreams(true, true, true)) {
|
||||
let pageURI = Services.io.newURI(streamData.uri, null, null);
|
||||
let menuitem = document.createElement("menuitem");
|
||||
menuitem.setAttribute("class", "menuitem-iconic");
|
||||
|
@ -38,12 +38,22 @@ this.webrtcUI = {
|
||||
showMicrophoneIndicator: false,
|
||||
showScreenSharingIndicator: "", // either "Screen" or "Window"
|
||||
|
||||
get activeStreams() {
|
||||
// The boolean parameters indicate which streams should be included in the result.
|
||||
getActiveStreams: function(aCamera, aMicrophone, aScreen) {
|
||||
let contentWindowSupportsArray = MediaManagerService.activeMediaCaptureWindows;
|
||||
let count = contentWindowSupportsArray.Count();
|
||||
let activeStreams = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
let contentWindow = contentWindowSupportsArray.GetElementAt(i);
|
||||
|
||||
let camera = {}, microphone = {}, screen = {}, window = {};
|
||||
MediaManagerService.mediaCaptureWindowState(contentWindow, camera,
|
||||
microphone, screen, window);
|
||||
if (!(aCamera && camera.value ||
|
||||
aMicrophone && microphone.value ||
|
||||
aScreen && (screen.value || window.value)))
|
||||
continue;
|
||||
|
||||
let browser = getBrowserForWindow(contentWindow);
|
||||
let browserWindow = browser.ownerDocument.defaultView;
|
||||
let tab = browserWindow.gBrowser &&
|
||||
|
Loading…
Reference in New Issue
Block a user