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

Screen capture does not work in 0.13 rc3 #4579

Closed
franchuk opened this issue Mar 16, 2016 · 6 comments
Closed

Screen capture does not work in 0.13 rc3 #4579

franchuk opened this issue Mar 16, 2016 · 6 comments
Assignees
Labels

Comments

@franchuk
Copy link

After selecting the screen or window i always get this:
failure NavigatorUserMediaError {name: "InvalidStateError", message: "", constraintName: ""}

nw.Screen.chooseDesktopMedia(
        ["window","screen"], function(streamId) {
             var vid_constraint = {
                  mandatory: {
                    chromeMediaSource: 'desktop', 
                    chromeMediaSourceId: streamId, 
                    maxWidth: 1920, 
                    maxHeight: 1080,
                    minFrameRate: 1,
                    maxFrameRate: 5
                  }, 
                  optional:[]
                };
                navigator.webkitGetUserMedia({audio:false,video: vid_constraint},
                    function(stream){
                        document.getElementById('video_1').src = URL.createObjectURL(stream);
                        stream.onended = function() { console.log("Ended"); };
                    }, 
                    function(error){
                        console.log('failure',error); 
                      // failure NavigatorUserMediaError {name: "InvalidStateError", message: "", constraintName: ""}
                });
    });

@rogerwang
Copy link
Member

Is it duplicate of #4459 ?

@ghostoy
Copy link
Member

ghostoy commented Mar 17, 2016

I can't reproduce this issue. nw.Screen.chooseDesktopMedia is literally the same as chrome.desktopCapture.chooseDesktopMedia. I tested on Windows, Mac and Linux (Ubuntu).

@franchuk Could you provide a full sample app?

@franchuk
Copy link
Author

Here is my app
app.nw.zip

@ghostoy
Copy link
Member

ghostoy commented Mar 18, 2016

This only happens on node-remote page. I'll look into it.

ghostoy pushed a commit to ghostoy/chromium.src that referenced this issue Mar 18, 2016
NWJS app allows running on origins other than `chrome-extension://*/*`.
The origin should then be from the senders URL, in order not to fail
the origin checking in `DesktopStreamsRegistry::RequestMediaForStreamId`.

Fixed nwjs/nw.js#4579
ghostoy pushed a commit to ghostoy/nw.js that referenced this issue Mar 18, 2016
NWJS app allows running on origins other than `chrome-extension://*/*`.
The origin should then be from the senders URL, in order not to fail
the origin checking in `DesktopStreamsRegistry::RequestMediaForStreamId`.

See also nwjs/chromium.src#11
@ghostoy
Copy link
Member

ghostoy commented Mar 18, 2016

@rogerwang There is similar issue with nw.Screen.DesktopCaptureMonitor. I've submitted another PR to fix it.

rogerwang added a commit that referenced this issue Mar 19, 2016
Fixed similar issue of #4579 for `nw.Screen.DesktopCaptureMonitor`
ghostoy pushed a commit to ghostoy/nw.js that referenced this issue Mar 29, 2016
The test case is based on `nw.Screen.DesktopCaptureMonitor`.
@ghostoy
Copy link
Member

ghostoy commented Mar 30, 2016

This issue was fixed since 0.13.0-rc4.

@ghostoy ghostoy closed this as completed Mar 30, 2016
rogerwang added a commit that referenced this issue Mar 30, 2016
@ghostoy ghostoy removed the test-todo label Jul 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants