Skip to content

Commit

Permalink
Now forcing audio/ogg on Firefox for audio-only recordings via #166
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Aug 28, 2016
1 parent 1d77bb2 commit 89ab8da
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
9 changes: 7 additions & 2 deletions RecordRTC.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

// Last time updated: 2016-08-17 9:06:10 AM UTC
// Last time updated: 2016-08-28 3:42:15 AM UTC

// Open-Sourced: https://github.com/muaz-khan/RecordRTC

Expand Down Expand Up @@ -1639,9 +1639,14 @@ function MediaStreamRecorder(mediaStream, config) {
mediaStream = stream;
}

if (!config.mimeType || config.mimeType.indexOf('audio') === -1) {
if (!config.mimeType || config.mimeType.toString().toLowerCase().indexOf('audio') === -1) {
config.mimeType = isChrome ? 'audio/webm' : 'audio/ogg';
}

if (config.mimeType && config.mimeType.toString().toLowerCase() !== 'audio/ogg' && !!navigator.mozGetUserMedia) {
// forcing better codecs on Firefox (via #166)
config.mimeType = 'audio/ogg';
}
}

This comment has been minimized.

Copy link
@thijstriemstra

thijstriemstra Sep 28, 2016

Contributor

@muaz-khan this change doesn't allow me to force a different audio mimetype anymore, e.g. audio/wav.


/**
Expand Down
Loading

0 comments on commit 89ab8da

Please sign in to comment.