Last active
August 29, 2015 14:14
-
-
Save karlosgliberal/4a71a2ae6fd6d99b3fb1 to your computer and use it in GitHub Desktop.
Uso del desktopCapture en google chrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.querySelector('#start').addEventListener('click', function(e) { | |
| pending_request_id = chrome.desktopCapture.chooseDesktopMedia( | |
| ["screen", "window"], onAccessApproved); | |
| }) | |
| function onAccessApproved(id) { | |
| if (!id) { | |
| console.log("Access rejected."); | |
| return; | |
| } | |
| navigator.webkitGetUserMedia({ | |
| audio:false, | |
| video: { | |
| mandatory: { | |
| chromeMediaSource: "desktop", | |
| chromeMediaSourceId: id, | |
| minWidth: "536", | |
| minHeight: "150", | |
| maxWidth: "536", | |
| maxHeight: "150" | |
| } | |
| } | |
| }, gotStream, getUserMediaError); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment