Skip to content

Commit

Permalink
Seems fixed muaz-khan#213
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Feb 14, 2017
1 parent 0be5b89 commit eb45016
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
10 changes: 6 additions & 4 deletions RecordRTC.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Last time updated: 2017-02-13 9:58:18 AM UTC
// Last time updated: 2017-02-14 5:18:41 AM UTC

// ________________
// RecordRTC v5.4.1
Expand Down Expand Up @@ -876,16 +876,18 @@ function MRecordRTC(mediaStream) {
};

if (typeof mediaType.audio !== 'function' && isMediaRecorderCompatible() && mediaStream.getAudioTracks && !mediaStream.getAudioTracks().length) {
// Firefox supports both audio/video in single blob
mediaType.audio = false;
}

if (typeof mediaType.video !== 'function' && isMediaRecorderCompatible() && mediaStream.getVideoTracks && !mediaStream.getVideoTracks().length) {
// Firefox supports both audio/video in single blob
mediaType.video = false;
}

if (!mediaType.audio && !mediaType.video) {
if (typeof mediaType.gif !== 'function' && isMediaRecorderCompatible() && mediaStream.getVideoTracks && !mediaStream.getVideoTracks().length) {
mediaType.gif = false;
}

if (!mediaType.audio && !mediaType.video && !mediaType.gif) {
throw 'MediaStream must have either audio or video tracks.';
}

Expand Down
6 changes: 3 additions & 3 deletions RecordRTC.min.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions dev/MRecordRTC.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,18 @@ function MRecordRTC(mediaStream) {
};

if (typeof mediaType.audio !== 'function' && isMediaRecorderCompatible() && mediaStream.getAudioTracks && !mediaStream.getAudioTracks().length) {
// Firefox supports both audio/video in single blob
mediaType.audio = false;
}

if (typeof mediaType.video !== 'function' && isMediaRecorderCompatible() && mediaStream.getVideoTracks && !mediaStream.getVideoTracks().length) {
// Firefox supports both audio/video in single blob
mediaType.video = false;
}

if (!mediaType.audio && !mediaType.video) {
if (typeof mediaType.gif !== 'function' && isMediaRecorderCompatible() && mediaStream.getVideoTracks && !mediaStream.getVideoTracks().length) {
mediaType.gif = false;
}

if (!mediaType.audio && !mediaType.video && !mediaType.gif) {
throw 'MediaStream must have either audio or video tracks.';
}

Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h2 class="header">
<br>

<button id="btn-start-recording">Start Recording</button>
<button id="btn-pause-recording" style="display: none; font-size: 15px;">Pause Recording</button>
<button id="btn-pause-recording" style="display: none; font-size: 15px;">Pause</button>

<hr style="border-top: 0;border-bottom: 1px solid rgb(189, 189, 189);margin: 4px -12px;margin-top: 8px;">
<select class="media-resolutions">
Expand Down Expand Up @@ -1650,7 +1650,7 @@ <h2 class="header">
}

btnPauseRecording.disabled = true;
if(btnPauseRecording.innerHTML === 'Pause Recording') {
if(btnPauseRecording.innerHTML === 'Pause') {
btnStartRecording.disabled = true;
btnStartRecording.style.fontSize = '15px';
btnStartRecording.recordRTC.pauseRecording();
Expand All @@ -1670,7 +1670,7 @@ <h2 class="header">
recordingPlayer.play();

btnPauseRecording.style.fontSize = '15px';
btnPauseRecording.innerHTML = 'Pause Recording';
btnPauseRecording.innerHTML = 'Pause';
setTimeout(function() {
btnPauseRecording.disabled = false;
}, 2000);
Expand Down

0 comments on commit eb45016

Please sign in to comment.