screen sharing has some problem in nwjs-v0.12.0-win-ia32
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)))
:+1: same behavior
@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"
Thanks @jtg-gg
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 you can use "screen:id" for chromeMediaSourceId for windows, the main screen id is 0, but for OSX is the screen.id