Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
La aplicación WebRTC de transmisión múltiple no funciona en Safari

Tengo una aplicación WebRTC personalizada que usa dos transmisiones de video y una transmisión de audio.

Todo funciona bien en Chrome (93.0) y Firefox (92.0), pero Safari (14.1) se niega a reproducir una de las secuencias (la del primer elemento de video con ID "secuencia").

HTML tiene el siguiente aspecto (principalmente marcadores de posición):

 <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <link rel="icon" href="data:;base64,iVBORw0KGgo="/> <script src="stream.js"></script> <style> </style> </head> <body> <div style="display:grid"> <video style="grid-column:1;grid-row:1;width:720px;z-index:5" id="stream" autoplay playsinline>Your browser does not support video</video> <canvas style="grid-column:1;grid-row:1;justify-self:end;width:1280px;height:720px;z-index:10" id="canvas"></canvas> <video style="grid-column:1;grid-row:1;justify-self:end;width:1280px;height:720px" id="stream2" autoplay playsinline>Your browser does not support video</video> </div> </body> </html>

La parte relevante del código Javascript ( html5VideoElement == ID "stream", html5VideoElement2 == ID "stream2"):

 function onAddRemoteStream(event) { if (event.transceiver.mid == remotemap["front"]) { frontstream.addTrack(event.track); html5VideoElement.srcObject = frontstream; html5VideoElement.play(); } if (event.transceiver.mid == remotemap["audio"]) { frontstream.addTrack(event.track); } if (event.transceiver.mid == remotemap["surface"]) { surfacestream.addTrack(event.track); html5VideoElement2.srcObject = surfacestream; html5VideoElement2.play(); } }

onAddRemoteStream es el método onTrack para el objeto RTCPeerConnection. remotemap contiene un mapeo del tipo de pista al valor MID, enviado por el par remoto. frontstream y surfacestream son dos objetos MediaStream (inicialmente vacíos).

Por extraño que parezca, no hay excepciones ni advertencias con ningún navegador, el primer elemento de video permanece vacío y en silencio con Safari.

Todas las transmisiones salientes (cámara, audio, lienzo) funcionan en los tres navegadores.

¡Cualquier sugerencia es bienvenida!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!