{"action":"created","issue":{"url":"https://api.github.com/repos/webrtc/adapter/issues/325","repository_url":"https://api.github.com/repos/webrtc/adapter","labels_url":"https://api.github.com/repos/webrtc/adapter/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/webrtc/adapter/issues/325/comments","events_url":"https://api.github.com/repos/webrtc/adapter/issues/325/events","html_url":"https://github.com/webrtc/adapter/issues/325","id":157957978,"number":325,"title":"sourceId not used on Chrome when mandatory/optional constraints are specified","user":{"login":"paleozogt","id":310894,"avatar_url":"https://avatars.githubusercontent.com/u/310894?v=3","gravatar_id":"","url":"https://api.github.com/users/paleozogt","html_url":"https://github.com/paleozogt","followers_url":"https://api.github.com/users/paleozogt/followers","following_url":"https://api.github.com/users/paleozogt/following{/other_user}","gists_url":"https://api.github.com/users/paleozogt/gists{/gist_id}","starred_url":"https://api.github.com/users/paleozogt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paleozogt/subscriptions","organizations_url":"https://api.github.com/users/paleozogt/orgs","repos_url":"https://api.github.com/users/paleozogt/repos","events_url":"https://api.github.com/users/paleozogt/events{/privacy}","received_events_url":"https://api.github.com/users/paleozogt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-01T17:01:57Z","updated_at":"2016-06-01T17:06:07Z","closed_at":null,"body":"**Browsers and versions affected**\r\nChrome, any version\r\n\r\n**Description**\r\nIf you use a constraint that has `mandatory` or `optional` fields, `constraintsToChrome_` will not correct `deviceId` to Chrome-compatible `sourceId`.\r\n\r\nFor example, if you do this:\r\n```\r\nnavigator.mediaDevices.getUserMedia({\r\n    audio: {\r\n        deviceId: {exact: myDeviceId}\r\n    }\r\n  });\r\n```\r\nit will get properly corrected to\r\n```{\r\n    \"audio\":{\r\n        \"mandatory\":{\r\n            \"sourceId\":\"...\"\r\n        }\r\n    }\r\n}```\r\n\r\nHowever, if you do this:\r\n```\r\nnavigator.mediaDevices.getUserMedia({\r\n    audio: {\r\n        mandatory: {echoCancellation: false},\r\n        deviceId: {exact: myDeviceId}\r\n    }\r\n  })\r\n```\r\nit essentially won't get modified:\r\n```{\r\n    \"audio\":{\r\n        \"mandatory\":{\r\n            \"echoCancellation\":false\r\n        },\r\n        \"deviceId\":{\r\n            \"exact\":\"...\"\r\n        }\r\n    }\r\n}```\r\n\r\n**Steps to reproduce**\r\n\r\nI've created a branch of the webrtc samples that shows the bug in the \"Choose camera, microphone and speaker\" demo:\r\n   https://github.com/paleozogt/samples/tree/deviceId_bug/src/content/devices/input-output\r\n\r\n**Expected results**\r\n\r\nUsing the new style `deviceId` constraint should get corrected to be `sourceId` on Chrome, no matter what other constraints are present.\r\n\r\n**Actual results**\r\n\r\nIf a `mandatory` or `optional` field is already in the constraints, `constraintsToChrome_` will not correct `deviceId` to Chrome-compatible `sourceId`.\r\n"},"comment":{"url":"https://api.github.com/repos/webrtc/adapter/issues/comments/223059482","html_url":"https://github.com/webrtc/adapter/issues/325#issuecomment-223059482","issue_url":"https://api.github.com/repos/webrtc/adapter/issues/325","id":223059482,"user":{"login":"fippo","id":289731,"avatar_url":"https://avatars.githubusercontent.com/u/289731?v=3","gravatar_id":"","url":"https://api.github.com/users/fippo","html_url":"https://github.com/fippo","followers_url":"https://api.github.com/users/fippo/followers","following_url":"https://api.github.com/users/fippo/following{/other_user}","gists_url":"https://api.github.com/users/fippo/gists{/gist_id}","starred_url":"https://api.github.com/users/fippo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fippo/subscriptions","organizations_url":"https://api.github.com/users/fippo/orgs","repos_url":"https://api.github.com/users/fippo/repos","events_url":"https://api.github.com/users/fippo/events{/privacy}","received_events_url":"https://api.github.com/users/fippo/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T17:06:06Z","updated_at":"2016-06-01T17:06:06Z","body":"@jan-ivar can you take a look? I suspect mixing new and legacy constraints is what is unsupported here."}}
{"actor":{"display_login":"fippo"}}