Skip to content
Snippets Groups Projects
Unverified Commit 11f0b656 authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #1229 from paulkaplan/fix-gum

Fix Firefox sound recording
parents 0baf6852 15fdab90
No related branches found
No related tags found
No related merge requests found
import 'get-float-time-domain-data'; import 'get-float-time-domain-data';
import getUserMedia from 'get-user-media-promise';
import SharedAudioContext from './shared-audio-context.js'; import SharedAudioContext from './shared-audio-context.js';
import {computeRMS} from './audio-util.js'; import {computeRMS} from './audio-util.js';
...@@ -22,17 +23,19 @@ class AudioRecorder { ...@@ -22,17 +23,19 @@ class AudioRecorder {
startListening (onStarted, onUpdate, onError) { startListening (onStarted, onUpdate, onError) {
try { try {
navigator.getUserMedia({audio: true}, userMediaStream => { getUserMedia({audio: true})
if (!this.disposed) { .then(userMediaStream => {
this.started = true; if (!this.disposed) {
onStarted(); this.started = true;
this.attachUserMediaStream(userMediaStream, onUpdate); onStarted();
} this.attachUserMediaStream(userMediaStream, onUpdate);
}, e => { }
if (!this.disposed) { })
onError(e); .catch(e => {
} if (!this.disposed) {
}); onError(e);
}
});
} catch (e) { } catch (e) {
if (!this.disposed) { if (!this.disposed) {
onError(e); onError(e);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment