closeio / mic-recorder-to-mp3

Microphone Recorder to mp3
MIT License
241 stars 135 forks source link

BUG: package dont ask for premission on mobile #27

Closed Mamoanwar97 closed 4 years ago

Mamoanwar97 commented 4 years ago

@buzinas please can you upload this to the npm package? This is a minior bug that will differ really much 🙏

buzinas commented 4 years ago

@mamoanwar97 If you don't pass any deviceId, it's already setting audio: true, as you can see a couple of lines above:

const audio = this.config.deviceId ? { deviceId: { exact: this.config.deviceId } } : true;
Mamoanwar97 commented 4 years ago

for some reason this isnot working on my project, it was working fine on laptops but on mobile phones it didn't work it wasn't asking for permission until I changed

navigator.mediaDevices.getUserMedia({ audio: audio })

to

navigator.mediaDevices.getUserMedia({ audio: true })

thanks anyway for this library

buzinas commented 4 years ago

And what shows up when you console.log(audio)?