Skip to content

Commit 468c92c

Browse files
committed
M61: fix desktopcapturemonitor
1 parent 86b3752 commit 468c92c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/api/nw_screen_api.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ namespace extensions {
205205
webrtc::DesktopCaptureOptions options = webrtc::DesktopCaptureOptions::CreateDefault();
206206
options.set_disable_effects(false);
207207

208-
media_list_.reset(new NativeDesktopMediaList(content::DesktopMediaID::TYPE_SCREEN, webrtc::DesktopCapturer::CreateScreenCapturer(options)));
208+
if (screens)
209+
media_list_.reset(new NativeDesktopMediaList(content::DesktopMediaID::TYPE_SCREEN, webrtc::DesktopCapturer::CreateScreenCapturer(options)));
210+
else if (windows)
211+
media_list_.reset(new NativeDesktopMediaList(content::DesktopMediaID::TYPE_WINDOW, webrtc::DesktopCapturer::CreateWindowCapturer(options)));
209212

210213
media_list_->StartUpdating(this);
211214
}

test/sanity/screen-desktopcapturemonitor/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
writeSuccess(eventName);
2424
})
2525
});
26-
nw.Screen.DesktopCaptureMonitor.start(true, true);
26+
nw.Screen.DesktopCaptureMonitor.start(false, true);
2727
} catch(e) {
2828
writeFailure(e);
2929
}
@@ -57,4 +57,4 @@
5757
}
5858
</script>
5959
</body>
60-
</html>
60+
</html>

0 commit comments

Comments
 (0)