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
How get the screen share stream id not use chooseDesktopMedia? #4459
Comments
OK,I found the stream id can be get without GUI by Screen.DesktopCaptureMonitor. |
are you using the nw.Screen API? does chrome.desktopCapture work for you? https://developer.chrome.com/extensions/desktopCapture |
Yes,I using nw.Screen.chooseDesktopMedia,And I test chrome.desktopCapture too, Both run the same results and the stream Id work fine with getUserMedia(),But I do not need to display the screen selection GUI Window,So the problem is the DesktopCaptureMonitor does not return the correct stream id. |
Of course, if the stream Id is reusable like in version 0.12, can also solve the problem. |
Could you please provide a sample? |
I think reusable stream id like version 0.12 is more friendly for Desktop Application, After tests also found a temporary stream Id pass to other windows's getUserMedia() is not work。 |
Stream id obtained internally should be registered with `DesktopStreamsRegistry`, which returns an randomly generated stream id valid for 10s, before passing to `getUserMedia()`. Fixed nwjs#4459
Stream id obtained internally should be registered with `DesktopStreamsRegistry`, which returns an randomly generated stream id valid for 10s, before passing to `getUserMedia()`. Fixed nwjs#4459
In Chrome, the stream id used by I'm proposing to add a new API var dcm = nw.Screen.DesktopCaptureMonitor;
dcm.on("added",function(id, name, order, type, primary){
// `id` is valid anywhere anytime and can be passed to any frame or window
var conf = {
mandatory: {
chromeMediaSource: 'desktop',
// register `id` to obtain a valid stream id before passing to `getUserMedia()`
chromeMediaSourceId: dcm.registerStream(id),
maxWidth: 1280,
maxHeight: 720
},
optional: []
};
// ...
navigator.webkitGetUserMedia(conf, callback);
}); Is the new API good for you? @sean220 |
Thanks for support,I have a few questions about the new API. |
|
Sorry,I found the comments in the code now. |
We are rebasing on CR49. I will let you know once it's available in live build. |
OK,We are looking forward to the CR49 version. |
Media source id returned by `added` event should be registered before using with `getUserMedia()`. Media source id, e.g. "screen:0", is permanent until removed, while registered stream id is a temporary one-time random string accessible only from the frame that requesting it. Fixed nwjs#4459
@sean220 build available, pls test: http://dl.nwjs.io/live-build/03-02-2016/12e5fb2-9285daa-3835621-8419c51/v0.13.0-rc1/ |
Well Done! It's works. |
Sure, we'll see it. Please file another issue for that. |
The chooseDesktopMedia() callback streamId can be used only once and expires after a few seconds when it is not used. But in 0.12 the streamId can always be reused,
Is there any way get a streamId, not by calling chooseDesktopMedia()?
The text was updated successfully, but these errors were encountered: