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 function gotStream(stream) { | 5 function gotStream(stream) { |
6 console.log("Received local stream"); | 6 console.log("Received local stream"); |
7 var video = document.querySelector("video"); | 7 var video = document.querySelector("video"); |
8 video.src = URL.createObjectURL(stream); | 8 video.src = URL.createObjectURL(stream); |
9 localstream = stream; | 9 localstream = stream; |
10 stream.onended = function() { console.log("Ended"); }; | 10 stream.onended = function() { console.log("Ended"); }; |
(...skipping 20 matching lines...) Expand all Loading... |
31 document.querySelector('#start').addEventListener('click', function(e) { | 31 document.querySelector('#start').addEventListener('click', function(e) { |
32 pending_request_id = chrome.desktopCapture.chooseDesktopMedia( | 32 pending_request_id = chrome.desktopCapture.chooseDesktopMedia( |
33 ["screen", "window"], onAccessApproved); | 33 ["screen", "window"], onAccessApproved); |
34 }); | 34 }); |
35 | 35 |
36 document.querySelector('#cancel').addEventListener('click', function(e) { | 36 document.querySelector('#cancel').addEventListener('click', function(e) { |
37 if (pending_request_id != null) { | 37 if (pending_request_id != null) { |
38 chrome.desktopCapture.cancelChooseDesktopMedia(pending_request_id); | 38 chrome.desktopCapture.cancelChooseDesktopMedia(pending_request_id); |
39 } | 39 } |
40 }); | 40 }); |
| 41 |
| 42 document.querySelector('#startFromBackgroundPage') |
| 43 .addEventListener('click', function(e) { |
| 44 chrome.runtime.sendMessage( |
| 45 {}, function(response) { console.log(response.farewell); }); |
| 46 }); |
OLD | NEW |