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

285
Visualizações
using navigator.mediaDevices.getUserMedia shows Black screen in IOS App using wkwebview. works fine in IOS safari browser

I have an IOS webview app and a site that triggers a script navigator.mediaDevices.getUserMedia to reduce the quality of the image while taking picture instead of compressor. we are using this script to open up a camera and take an image.

Its works fine in IOS safari browser it opens the camera and takes a picture in low quality but it does not work in IOS app webview.

In IOS app its shows a black screen and while debugging the app it throws Unhandled Promise Rejection: notallowederror: User Denied Even after giving the permission twice one from the browser side and another from app side.

<video id="video" playsinline autoplay muted> </video>

var constraints = { video: { facingMode: { exact: "environment", } } };

navigator.mediaDevices.getUserMedia(constraints)
   .then(function (stream) {
   var video = document.querySelector('video');
   video.setAttribute('autoplay', '');
   video.setAttribute('muted', '');
   video.setAttribute('playsinline', '');
   video.srcObject = stream;

   video.onloadedmetadata = function (e) {
     $('#containercamera').show();
   };

})

ps:

  • using https
  • working in ios safari browser.
  • Added permission in IOS app for Camera.
about 4 years ago · Juan Pablo Isaza
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