Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop screensharing on microphone permissions error in AUDIO_SCREEN mode #585

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
to control start of converter process (#568)
- Improve check in `removeRecording` (#575)
- Bump required version for webrtc-adapter (8.0.0 or newer)
- Stop screen sharing on a microphone permissions error in the AUDIO_SCREEN mode (#585)


## 4.4.0 - 2021/04/05
Expand Down
11 changes: 8 additions & 3 deletions src/js/videojs.record.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,14 @@ class Record extends Plugin {
// join microphone track with screencast stream (order matters)
screenStream.addTrack(mic.getTracks()[0]);
this.onDeviceReady.bind(this)(screenStream);
}).catch(
this.onDeviceError.bind(this)
);
}).catch((code) => {
// here the screen sharing is in progress as successful result of navigator.mediaDevices.getDisplayMedia and
// needs to be stopped because microphone permissions are not acquired by navigator.mediaDevices.getUserMedia
if (screenStream.active) {
thijstriemstra marked this conversation as resolved.
Show resolved Hide resolved
screenStream.stop();
}
this.onDeviceError(code);
});
}).catch(
this.onDeviceError.bind(this)
);
Expand Down