OLD | NEW |
---|---|
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']; |
mark a. foltz
2016/01/04 20:11:41
Maybe don't expose this until you've landed all ne
GeorgeZ
2016/01/06 22:41: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 Loading... | |
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 } |
OLD | NEW |