Closed benmackerras closed 6 years ago
In reference to https://github.com/closeio/mic-recorder-to-mp3/issues/3
@buzinas 👆
This works for me on Firefox 63.0.1 macos as well as Chrome 70.0.3538.77 (macos) ..
Since we were just setting deviceId to 'default' I think its ok to remove.
We are setting deviceId
to 'default'
as default, but this config exists to be overwritten by the consumer. Check Object.assign(this.config, config)
. This PR would break the current code.
~Btw, I can't reproduce the problem, what are the steps @benmackerras?~
Edit: I was able to reproduce the problem, and it happens because Firefox no longer has a 'default' deviceId
. The ideal PR would remove the 'default'
on the constructor and then do something like:
const audio = this.config.deviceId ? { deviceId: { exact: this.config.deviceId } } : true;
For now, you can workaround it to make the library work on Firefox with something like:
navigator.userMedia.enumerateDevices().then(devices => {
const recorder = new MicRecorder({
deviceId: devices.find(device => device.kind ==='audioinput').deviceId,
});
// and the rest is the same
});
Bug fix for firefox OverconstrainedError. Since we were just setting deviceId to 'default' I think its ok to remove.