Skip to content

Instantly share code, notes, and snippets.

@karlosgliberal
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save karlosgliberal/4a71a2ae6fd6d99b3fb1 to your computer and use it in GitHub Desktop.

Select an option

Save karlosgliberal/4a71a2ae6fd6d99b3fb1 to your computer and use it in GitHub Desktop.
Uso del desktopCapture en google chrome
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