Problem with microphone permissions in dev environment


#1

Hi there,

Currently jovo-client-web is throwing an error in AudioRecorder.ts if the website is not run on a secured url:

private checkForBrowserCompatibility() {
    if (location.hostname !== 'localhost' && location.protocol !== 'https:') {
      throw new Error('Recording is only allowed on https-sites except for localhost.');
    }
    // ...
  }

Because of our development environment of our company, I am not developing on localhost. Therefore, this check obstructs me to locally test my jovo-for-web integration. Is it possible to disable this security check in dev?


#2

You mean you have a custom local domain like https://myapp.local? Is it available via HTTPS?

cc @Max


#3

Hi @AlexSwe and @Max,
That is correct: the url of or development environment looks something like yours. Unfortunately, the environment is not available via HTTPS. Therefore, also the second query with location.protocol !== 'https:' in the AudioRecorder.ts is true.


#4

Hello there,

this check exists due to the requirement of getUserMedia, which is explained here https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#exceptions. Basically, accessing getUserMedia does only work in a secure context (https or localhost).
I would recommend setting up HTTPS for the development-server.

I hope this helps, if you have any more questions just let me know.


#5

Dear Max,
We will definitely consider setting up HTTPS. Thanks for the response.
Best, Fabian