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

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

Issue 1503563004: Desktop chrome tab capture-chooseDesktopMedia() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review round 3 Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 const DESKTOP_MEDIA = ['screen', 'window']; 7 const DESKTOP_MEDIA = ['screen', 'window', "tab"];
Ken Rockot(use gerrit already) 2015/12/15 00:06:16 nit: Please keep quote styles consistent
GeorgeZ 2015/12/16 00:07:39 Done.
8 8
9 var pending_request_id = null; 9 var pending_request_id = null;
10 var pc1 = null; 10 var pc1 = null;
11 var pc2 = null; 11 var pc2 = null;
12 12
13 // Launch the chooseDesktopMedia(). 13 // Launch the chooseDesktopMedia().
14 document.querySelector('#start').addEventListener('click', function(event) { 14 document.querySelector('#start').addEventListener('click', function(event) {
15 pending_request_id = chrome.desktopCapture.chooseDesktopMedia( 15 pending_request_id = chrome.desktopCapture.chooseDesktopMedia(
16 DESKTOP_MEDIA, onAccessApproved); 16 DESKTOP_MEDIA, onAccessApproved);
17 }); 17 });
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 var remotePC = (pc === pc1) ? pc2 : pc1; 113 var remotePC = (pc === pc1) ? pc2 : pc1;
114 remotePC.addIceCandidate(new RTCIceCandidate(event.candidate)); 114 remotePC.addIceCandidate(new RTCIceCandidate(event.candidate));
115 } 115 }
116 } 116 }
117 117
118 function onIceStateChange(pc, event) { 118 function onIceStateChange(pc, event) {
119 if (pc) { 119 if (pc) {
120 console.log('ICE state change event: ', event); 120 console.log('ICE state change event: ', event);
121 } 121 }
122 } 122 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698