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

166
Visualizações
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 à 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