Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4755)

Unified Diff: chrome/common/extensions/docs/examples/api/desktopCapture/app.js

Issue 2547633002: Desktop Capture API: Pass Audio Selection Information To Javascript (Closed)
Patch Set: Use Object Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/examples/api/desktopCapture/app.js
diff --git a/chrome/common/extensions/docs/examples/api/desktopCapture/app.js b/chrome/common/extensions/docs/examples/api/desktopCapture/app.js
index e7ae8bc3051d640acf5c5f4820cfe407b2aa6ac0..12ce51beb56f439ffc10bd29ad1e4c9a8c4f46ec 100644
--- a/chrome/common/extensions/docs/examples/api/desktopCapture/app.js
+++ b/chrome/common/extensions/docs/examples/api/desktopCapture/app.js
@@ -29,17 +29,21 @@ document.querySelector('#startFromBackgroundPage')
});
// Launch webkitGetUserMedia() based on selected media id.
-function onAccessApproved(id) {
+function onAccessApproved(id, options) {
if (!id) {
console.log('Access rejected.');
return;
}
- navigator.webkitGetUserMedia({
- audio:{
+ var audio_constraint = {
Devlin 2016/12/13 16:05:44 js-style variable, so audioConstraint
qiangchen 2016/12/13 19:04:33 Done.
mandatory: {
chromeMediaSource: 'desktop',
- chromeMediaSourceId: id} },
+ chromeMediaSourceId: id} };
Devlin 2016/12/13 16:05:44 The wrapping here was already weird, but let's cle
qiangchen 2016/12/13 19:04:33 Done.
+
+ if (!options.can_request_audio_track) audio_constraint = false;
Devlin 2016/12/13 16:05:44 if bodies should go on separate lines, so this wou
qiangchen 2016/12/13 19:04:32 Done.
+
+ navigator.webkitGetUserMedia({
+ audio: audio_constraint,
video: {
mandatory: {
chromeMediaSource: 'desktop',

Powered by Google App Engine
This is Rietveld 408576698