Skip to content

Commit

Permalink
getUserMedia constraints: Allow sourceId (rather than just `deviceI…
Browse files Browse the repository at this point in the history
…d`) to make adapter.js happy (should fix #282).
  • Loading branch information
ibc committed May 25, 2017
1 parent c4e0ea0 commit 80120e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/getUserMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ function getUserMedia(constraints) {
// Get requested video deviceId.
if (typeof constraints.video.deviceId === 'string') {
newConstraints.videoDeviceId = constraints.video.deviceId;
// Also check sourceId (mangled by adapter.js).
} else if (typeof constraints.video.sourceId === 'string') {
newConstraints.videoDeviceId = constraints.video.sourceId;
}

// Get requested min/max width.
Expand Down

0 comments on commit 80120e0

Please sign in to comment.