mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1037408 - add booleans to webrtcUI indicating which sharing indicators should be shown, r=dolske.
This commit is contained in:
parent
89f4a776d8
commit
66a9db8c30
@ -34,6 +34,9 @@ this.webrtcUI = {
|
||||
},
|
||||
|
||||
showGlobalIndicator: false,
|
||||
showCameraIndicator: false,
|
||||
showMicrophoneIndicator: false,
|
||||
showScreenSharingIndicator: "", // either "Screen" or "Window"
|
||||
|
||||
get activeStreams() {
|
||||
let contentWindowSupportsArray = MediaManagerService.activeMediaCaptureWindows;
|
||||
@ -390,15 +393,35 @@ function prompt(aContentWindow, aCallID, aAudio, aVideo, aDevices, aSecure) {
|
||||
}
|
||||
|
||||
function updateIndicators() {
|
||||
webrtcUI.showGlobalIndicator =
|
||||
MediaManagerService.activeMediaCaptureWindows.Count() > 0;
|
||||
let contentWindowSupportsArray = MediaManagerService.activeMediaCaptureWindows;
|
||||
let count = contentWindowSupportsArray.Count();
|
||||
|
||||
webrtcUI.showGlobalIndicator = count > 0;
|
||||
|
||||
let e = Services.wm.getEnumerator("navigator:browser");
|
||||
while (e.hasMoreElements())
|
||||
e.getNext().WebrtcIndicator.updateButton();
|
||||
|
||||
for (let {browser: browser} of webrtcUI.activeStreams)
|
||||
showBrowserSpecificIndicator(browser);
|
||||
webrtcUI.showCameraIndicator = false;
|
||||
webrtcUI.showMicrophoneIndicator = false;
|
||||
webrtcUI.showScreenSharingIndicator = "";
|
||||
|
||||
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 (camera.value)
|
||||
webrtcUI.showCameraIndicator = true;
|
||||
if (microphone.value)
|
||||
webrtcUI.showMicrophoneIndicator = true;
|
||||
if (screen.value)
|
||||
webrtcUI.showScreenSharingIndicator = "Screen";
|
||||
else if (window.value && !webrtcUI.showScreenSharingIndicator)
|
||||
webrtcUI.showScreenSharingIndicator = "Window";
|
||||
|
||||
showBrowserSpecificIndicator(getBrowserForWindow(contentWindow));
|
||||
}
|
||||
}
|
||||
|
||||
function showBrowserSpecificIndicator(aBrowser) {
|
||||
|
Loading…
Reference in New Issue
Block a user