{"action":"created","issue":{"url":"https://api.github.com/repos/twilio/twilio-video.js/issues/99","repository_url":"https://api.github.com/repos/twilio/twilio-video.js","labels_url":"https://api.github.com/repos/twilio/twilio-video.js/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/twilio/twilio-video.js/issues/99/comments","events_url":"https://api.github.com/repos/twilio/twilio-video.js/issues/99/events","html_url":"https://github.com/twilio/twilio-video.js/issues/99","id":225959952,"number":99,"title":"Screen capture : createLocalVideoTrack creating webcam track instead of screen","user":{"login":"theDude30","id":5785389,"avatar_url":"https://avatars1.githubusercontent.com/u/5785389?v=4","gravatar_id":"","url":"https://api.github.com/users/theDude30","html_url":"https://github.com/theDude30","followers_url":"https://api.github.com/users/theDude30/followers","following_url":"https://api.github.com/users/theDude30/following{/other_user}","gists_url":"https://api.github.com/users/theDude30/gists{/gist_id}","starred_url":"https://api.github.com/users/theDude30/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theDude30/subscriptions","organizations_url":"https://api.github.com/users/theDude30/orgs","repos_url":"https://api.github.com/users/theDude30/repos","events_url":"https://api.github.com/users/theDude30/events{/privacy}","received_events_url":"https://api.github.com/users/theDude30/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-05-03T11:48:51Z","updated_at":"2017-11-01T17:36:16Z","closed_at":"2017-05-03T13:01:07Z","author_association":"NONE","body":"Hi,\r\nI'm trying to do screen capture, I've managed to do the following:\r\n1. get token.\r\n2. install extension.\r\n3. select the desktop and get sourceID response.\r\n4. used navigator.getUserMedia with the given sourceID.\r\n\r\nNow when i do \"Video.createLocalVideoTrack with the stream.getVideoTracks()[0]\" it start capturing the webcam.\r\nWhat am i missing? \r\n\r\n\r\n - [X ] I have verified that the issue occurs with the latest twilio-video.js release and is not marked as a known issue in the [CHANGELOG.md](https://github.com/twilio/twilio-video.js/blob/master/CHANGELOG.md).\r\n - [X ] I reviewed the [Common Issues](https://github.com/twilio/twilio-video.js/blob/master/COMMON_ISSUES.md) and open GitHub issues and verified that this report represents a potentially new issue.\r\n - [X ] I verified that the [Quickstart](https://github.com/twilio/video-quickstart-js) application works in my environment.\r\n\r\n**Code to reproduce the issue:**\r\n\r\n   navigator.mediaDevices.getUserMedia({\r\n                                    video: {\r\n                                        mandatory: {\r\n                                            chromeMediaSource: 'desktop',\r\n                                            chromeMediaSourceId: respData.sourceId\r\n                                        }\r\n                                    }\r\n                                }).then(function (stream) {\r\n                                   var localStream= Video.createLocalVideoTrack(stream.getVideoTracks()[0]).then(function(localTracks) {\r\n                                        var currentLocalTrack=localTracks;\r\n                                        var localMediaContainer = document.getElementById('localVideo');\r\n                                            localMediaContainer.appendChild(currentLocalTrack.attach());\r\n                                            Twilio.Video.connect(data.token, {\r\n                                                name: room,\r\n                                                tracks: [currentLocalTrack],\r\n                                                audio: false,\r\n                                                video:false\r\n                                            }).then(function (twRoom) {\r\n                                                twRoom.localParticipant.addTrack(currentLocalTrack);\r\n                                                console.log('Connected to room ' + twRoom.name + ' with screen sharing');\r\n                                        });\r\n                                    });\r\n                                });\r\n\r\n\r\n**Expected behavior:**\r\n\r\nThe screen should be shared(i even got the google message that the screen is being shared)\r\n\r\n**Actual behavior:**\r\n\r\nIt captures my webcam.\r\n\r\n**Software versions:**\r\n\r\n - [X ] Browser(s):Chrome 58.0.3029.96 (64-bit)\r\n - [X ] Operating System: OSX 10.12.4\r\n - [ X] twilio-video.js: 1.0.0\r\n - [ X] Third-party libraries (e.g., Angular, React, etc.): None(basic javascript+jquery).\r\n"},"comment":{"url":"https://api.github.com/repos/twilio/twilio-video.js/issues/comments/341180580","html_url":"https://github.com/twilio/twilio-video.js/issues/99#issuecomment-341180580","issue_url":"https://api.github.com/repos/twilio/twilio-video.js/issues/99","id":341180580,"user":{"login":"Arthur447","id":1047054,"avatar_url":"https://avatars1.githubusercontent.com/u/1047054?v=4","gravatar_id":"","url":"https://api.github.com/users/Arthur447","html_url":"https://github.com/Arthur447","followers_url":"https://api.github.com/users/Arthur447/followers","following_url":"https://api.github.com/users/Arthur447/following{/other_user}","gists_url":"https://api.github.com/users/Arthur447/gists{/gist_id}","starred_url":"https://api.github.com/users/Arthur447/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arthur447/subscriptions","organizations_url":"https://api.github.com/users/Arthur447/orgs","repos_url":"https://api.github.com/users/Arthur447/repos","events_url":"https://api.github.com/users/Arthur447/events{/privacy}","received_events_url":"https://api.github.com/users/Arthur447/received_events","type":"User","site_admin":false},"created_at":"2017-11-01T17:36:16Z","updated_at":"2017-11-01T17:36:16Z","author_association":"NONE","body":"Hi @manjeshbhargav ,\r\n\r\nI am generating token from server side with Twilio PHP Library v4 but only for authenticated users, your error is normal. \r\n\r\nI think that i found the issue and solved it yesterday with this code\r\n\r\n```\r\n                    var connectOptions = {\r\n                        name: roomName,\r\n                        logLevel: 'debug',\r\n                        iceServers: [ { 'urls': 'stun:stun.l.google.com:19302'} ] \r\n                    };\r\n```\r\n\r\nAs you can see, i use Google stun server and it worked with my local tests.\r\nI will do more tests in real conditions and keep you inform if you want,\r\n\r\nThanks,\r\nArthur"}}
{"actor":{"display_login":"Arthur447"}}