nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

screen sharing has some problem in nwjs-v0.12.0-win-ia32

Open waiting0729 opened this issue 11 years ago • 5 comments

hello all:)i want to use node-webkit for screen sharing,using webrtc.In node-webkit-v0.11.5-win everything is working ok.But in nwjs-v0.12.0-win,it has some problem .

my code : function init(){ navigator.webkitGetUserMedia({audio: false, video: { mandatory: { chromeMediaSource: 'screen', maxWidth: 1280, maxHeight: 720 }, optional: [] }}, function(stream) { document.getElementById('camFeed').src = webkitURL.createObjectURL(stream); }, function() { alert("Error"); } ); }

and package.json: { "name":"user-media", "main":"index.html", "chromium-args" : "--enable-usermedia-screen-capturing", "window":{ "frame":true, "toolbar": true } } When I run the program,it appear "alert(error)",What am I doing wrong here? Thanks in advance)))

waiting0729 avatar Mar 12 '15 07:03 waiting0729

:+1: same behavior

SeyZ avatar Mar 16 '15 14:03 SeyZ

@waiting0729 it only work on nwjs 0.12.0 and above @SeyZ please read the documentation https://github.com/nwjs/nw.js/wiki/Screen#screenchoosedesktopmedia-array-of-desktopcapturesourcetype-sources-function-callback

and you don't need the chrome args "--enable-usermedia-screen-capturing"

jtg-gg avatar Mar 17 '15 03:03 jtg-gg

Thanks @jtg-gg

SeyZ avatar Mar 17 '15 10:03 SeyZ

Thanks @jtg-gg,I have read the https://github.com/nwjs/nw.js/wiki/Screen#screenchoosedesktopmedia-array-of-desktopcapturesourcetype-sources-function-callback,and try it .But it shows screen to be chosen,it does not i want.I only want to share the whole screen on one step ,do not need choose.what shoud i do to sovle this problem

waiting0729 avatar Mar 19 '15 02:03 waiting0729

@waiting0729 you can use "screen:id" for chromeMediaSourceId for windows, the main screen id is 0, but for OSX is the screen.id

jtg-gg avatar Mar 19 '15 03:03 jtg-gg