Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 026bb52

Browse files
committed
touching up error messages
- add new formats to the list of recognizable ones - clarify what 'Invalid constraint' means (no microphone access allowed - happens in Safari on iPod touch even when running iOS 11)
1 parent ae4a9c2 commit 026bb52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

views/demo.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,14 @@ export default React.createClass({
343343
handleError(err, extra) {
344344
console.error(err, extra);
345345
if (err.name === 'UNRECOGNIZED_FORMAT') {
346-
err = 'Unable to determine content type from file header; only mp3, wav, flac, and ogg/opus are supported. Please choose a different file.';
346+
err = 'Unable to determine content type from file name or header; mp3, wav, flac, ogg, opus, and webm are supported. Please choose a different file.';
347347
} else if (err.name === 'NotSupportedError' && this.state.audioSource === 'mic') {
348348
err = 'This browser does not support microphone input.';
349349
} else if (err.message === '(\'UpsamplingNotAllowed\', 8000, 16000)') {
350350
err = 'Please select a narrowband voice model to transcribe 8KHz audio files.';
351+
} else if (err.message === 'Invalid constraint') {
352+
// iPod Touch does this on iOS 11 - there is a microphone, but Safari claims there isn't
353+
err = 'Unable to access microphone';
351354
}
352355
this.setState({ error: err.message || err });
353356
},

0 commit comments

Comments
 (0)