Skip to content

Commit

Permalink
Merged code from muaz-khan#204
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Jan 5, 2017
1 parent da6b64d commit ce17741
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
17 changes: 14 additions & 3 deletions RecordRTC.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Last time updated: 2016-12-25 3:20:46 PM UTC
// Last time updated: 2017-01-05 10:11:56 AM UTC

// ________________
// RecordRTC v5.4.0
Expand Down Expand Up @@ -765,8 +765,19 @@ function GetRecorderType(mediaStream, config) {
}

if (isMediaRecorderCompatible() && recorder !== CanvasRecorder && recorder !== GifRecorder && typeof MediaRecorder !== 'undefined' && 'requestData' in MediaRecorder.prototype) {
if (mediaStream.getVideoTracks().length) {
recorder = MediaStreamRecorder;
if (mediaStream.getVideoTracks().length || mediaStream.getAudioTracks().length) {
// audio-only recording
if (config.type === 'audio') {
if (typeof MediaRecorder.isTypeSupported === 'function' && MediaRecorder.isTypeSupported('audio/webm')) {
recorder = MediaStreamRecorder;
}
// else recorder = StereoAudioRecorder;
} else {
// video or screen tracks
if (typeof MediaRecorder.isTypeSupported === 'function' && MediaRecorder.isTypeSupported('video/webm')) {
recorder = MediaStreamRecorder;
}
}
}
}

Expand Down
Loading

0 comments on commit ce17741

Please sign in to comment.