Skip to content

Commit

Permalink
Stop screensharing on microphone permissions error in AUDIO_SCREEN mo…
Browse files Browse the repository at this point in the history
…de (#585)
  • Loading branch information
RomanMukhin committed Jun 12, 2021
1 parent 28b0964 commit 62e70e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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) {
screenStream.stop();
}
this.onDeviceError(code);
});
}).catch(
this.onDeviceError.bind(this)
);
Expand Down

0 comments on commit 62e70e4

Please sign in to comment.