javascript - Using Node Web Kit GUI, how do you close a Screen? -
i'm trying use node web kits screen broadcasting capture image of video applying canvas. i'm using angularjs switch between video , canvas.
i'm opening , initializing video :
gui.screen.init(); gui.screen.choosedesktopmedia( ["window", "screen"], function(streamid) { var vid_constraint = { mandatory: { chromemediasource: 'desktop', chromemediasourceid: streamid, maxwidth: 900, maxheight: 600, minframerate: 1, maxframerate: 5 }, optional: [] }; navigator.webkitgetusermedia({ audio: false, video: vid_constraint }, function(stream) { console.log(stream, typeof url.createobjecturl(stream)); video.src = url.createobjecturl(stream); }, function(error) { console.log('failure', error); }); });
i send image of screen applying temp canvas , switching view using ng-if:
// first steps in angular transition $scope.takephoto = function() { console.log("draw") context.drawimage(video, 0, 0, 900, 600); var sendvid = canvas.todataurl(); $rootscope.$broadcast("send video data", {show: false, videoimage : sendvid}) gui.screen.stop(); };
then when try initialize new gui doesn't work. error:
typeerror: undefined not function @ new videoctrl (video-capture-directive.js:20) @ object.invoke (angular.js:4476) @ extend.instance (angular.js:9127) @ nodelinkfn (angular.js:8239) @ delayednodelinkfn (angular.js:8528) @ compositelinkfn (angular.js:7671) @ publiclinkfn (angular.js:7546) @ boundtranscludefn (angular.js:7690) @ controllersboundtransclude (angular.js:8307) @ object.ngifwatchaction [as fn] (angular.js:23994)
why can't close window , open new one?
Comments
Post a Comment