Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

290
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda