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

170
Vistas
Sending a stream from native to webview

I am developing Webview with react native and facing an issue.

I have started working with peerjs to stream to mic and camera, problem is it asked me twice for permissions to the camera and mic, once in the native level and second in the webview level (prompt also shows the website address).

To prevent that, i am inserting webrtc directly on native (react-native-webrtc lib) and trying to stream to the video element inside the webrtc through injectJavaScript. Problem is it doesn't know how to work with the stream object and breaks the JS code.

I did this test on iOS only. Code:

this.webView.injectJavaScript(`
video = document.getElementById('myvid');   
video.srcObject = data;
video.on("loadedmetadata", () => {
    alert(0);
    video.play();
});

`);

The code doesn't do anything, probably breaks the JS because I've tried to see if it continues but it stops after the line: video.srcObject = data;

Is there a way to solve it?

Thank you!

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