Skip to content

Commit

Permalink
Request webcam before display share
Browse files Browse the repository at this point in the history
If sharing a specific window from the desktop, some browsers bring
that window into the foreground. If it does not overlap the browser
window, users might be confused as the webcam is not requested. This
only happens after the browser window is focused again. Changing the
order works around this problem.
  • Loading branch information
LukasKalbertodt authored and luniki committed Jan 28, 2020
1 parent d12ddae commit 66865d3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/ui/studio/video-setup/display-and-user-media.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ export default function SourceDisplayAndUserMedia() {

const handleShare = useCallback(
event => {
startDisplayCapture(dispatch).then(() => {
const userConstraints = {
video: { height: { ideal: 1080 }, facingMode: 'user' },
audio: false
};
startUserCapture(dispatch, userConstraints);
});
const userConstraints = {
video: { height: { ideal: 1080 }, facingMode: 'user' },
audio: false
};
startUserCapture(dispatch, userConstraints)
.then(() => startDisplayCapture(dispatch));
},
[dispatch]
);
Expand Down

0 comments on commit 66865d3

Please sign in to comment.