Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop capture monitor and desktop audio on Windows #3574

Merged
merged 6 commits into from Jul 17, 2015

Conversation

redgecombe
Copy link

This is API plumbing for the internal interfaces chromium uses to enumerate desktop capture streams and for getting their thumbnails. It allows for apps to implement their own desktop capture picker window in HTML/Javascript.

Here is a sample app that uses the API:
https://gist.github.com/redgecombe/835fe42b8308a0afaecc

gui.Screen.Init();
gui.Screen.DesktopCaptureMonitor.start(should_include_screens, should_include_monitors); //The screen capture API will monitor the system and trigger the below events.

To stop:
gui.Screen.DesktopCaptureMonitor.stop(); //The screen capture system will stop monitoring the system.

Events:
gui.Screen.DesktopCaptureMonitor.on("added", function (id, name, order, type, primary) {
//id is unique id that can be passed as chromeMediaSourceId
//name is the title of the window or screen
//order is the z-order of the windows, if screens are selected they will appear first
//type of the stream: "screen", "window", "other" or "unknown"
});
gui.Screen.DesktopCaptureMonitor.on("removed", function (id) {
//the id of the screen or monitor that is no longer capturable
});
gui.Screen.DesktopCaptureMonitor.on("orderchanged", function (id, new_order, old_order) {
//id is the screen or window that has changed z-order
//new_order is the new z-order
//old_order is the old z-order
});
gui.Screen.DesktopCaptureMonitor.on("namechanged", function (id, name) {
//id is the screen or window that has changed title
//name is the title
});
gui.Screen.DesktopCaptureMonitor.on("thumbnailchanged", function (id, thumbnail) {
//id is the screen or window that has an updated thumbnail
//thumbnail is the base64 encoded png of the thumbnail
});

@metal3d
Copy link

metal3d commented Jun 23, 2015

Maybe you can try on a Linux box ? because capturing dekstop on linux + audio doesn't work. You may have found a common problem.

@redgecombe
Copy link
Author

This screen selection should work on Linux, but not the audio capture. I think Linux desktop audio is not supported in chromium yet: https://code.google.com/p/chromium/issues/detail?id=223639#c29

rogerwang added a commit that referenced this pull request Jul 17, 2015
Desktop capture monitor and desktop audio on Windows
@rogerwang rogerwang merged commit c396045 into nwjs:master Jul 17, 2015
@rogerwang
Copy link
Member

Thanks. This will be released with 0.12.3. And please add another PR to add yourself to AUTHORS.

@redgecombe redgecombe mentioned this pull request Jul 21, 2015
@rogerwang
Copy link
Member

@redgecombe could you please add the documentation to https://github.com/nwjs/nw.js/wiki/Screen ?

Then I'll announce v0.12.3 with this feature.

@redgecombe
Copy link
Author

@rogerwang Added the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants