Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

412
Visualizações
Chrome does not prompt user for camera and/or microphone access even in secure context

I have a webpage served via https with the following script:

const userMediaConstraints = {
    video: true,
    audio: true
};

navigator.mediaDevices.getUserMedia(userMediaConstraints)
    .then(stream => { 
        console.log("Media stream captured.")
    });

When I open it in Firefox or Safari, a prompt asking for permission to use camera and microphone appears. But not in Chrome or Opera. There the access is blocked by default and I have to go to site settings and manually allow the access, which is set to Default(ask).

  • window.isSecureContext is true.
  • navigator.permissions.query({name:'camera'}) resolves to name: "video_capture", onchange: null, state: "prompt".

It looks like Chrome and Opera should show prompt, but they do not. I tested it on a different machine with different user that had no prior history with the website with the same result.

What could be wrong?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You've said you've tried Safari, which suggests to me you're on a Mac.

This issue on the Chrome issues list fits your description really well. (I got there from this on the webrtc/samples GitHub project.) It comes down to a Mac OS security setting. Quoting comment #3:

Please check in Mac system preferences > Security & Privacy > Privacy > Microphone, that Chrome is checked.

(In your case since you want video, you'd also probably have to tick the box under Security & Privacy > Privacy > Camera or similar.)

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda