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

150
Views
WebRTC: cómo agregar MediaStream a RTCPeerConnection existente (que no tiene ningún MediaStream adjunto)

Tengo RTCPeerConnection entre 2 pares. Estos 2 compañeros pueden intercambiar mensajes y todo funciona bien en su comunicación. Pero ahora me gustaría agregar una transmisión a este RTCPeerConnection. Yo lo hago así:

 if(stream)if(This.myRTCMediaConnections[id][hash].addTrack){ stream.getTracks().forEach(function(track){ This.myRTCMediaConnections[id][hash].addTrack(track,stream) }) } else This.myRTCMediaConnections[id][hash].addStream(stream)

después de hacerlo, el evento ontrack se dispara en otro lado:

 this.myRTCMediaConnections[id][hash].ontrack=function(e){ if(CAE(This.callRequests,id)){ delete This.callRequests[id] This.insertVideoElement(logicGroupName,targetId,id,hash,e.streams[0],!noVideo) } }

donde agrego un elemento de video como este:

 video.srcObject=stream

Sin embargo, crea una etiqueta de video vacía donde el evento "datos cargados" nunca se activa, lo que significa que hay algún problema con la transmisión recibida.

¿Alguien puede guiarme sobre lo que estoy haciendo mal y hay alguna manera de agregar una transmisión a RTCPeerConnection existente?

¡Gracias!

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!