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

101
Views
cómo cambiar de pantalla compartida a cámara nuevamente con RTCMultiConnection

Necesito cambiar de compartir pantalla a video nuevamente. Primero uso este código para compartir la pantalla. conexión.addStream ({ pantalla: verdadero, oneway: verdadero, streamCallback: función (pantalla) { addStreamStopListener (pantalla, función () { selectFrontCameraDuringActiveSession (); }); }, })

y luego uso este código para mostrar el video que estoy haciendo mal nuevamente.

 connection.attachStreams.forEach (function (stream) { // stop only video tracks // so that we can recapture video track stream.getVideoTracks (). forEach (function (track) { track.stop (); }); }); var mediaConstraints = { audio: false, // NO need to capture audio again video: { facingMode: "application", }, }; navigator.mediaDevices .getUserMedia (mediaConstraints) .then (function (frontCamera) { var frontCameraTrack = frontCamera.getVideoTracks () [0]; //video.srcObject = frontCamera; connection.getAllParticipants (). forEach (function (pid) { connection.peers [pid] .peer .getSenders () .forEach (function (sender) { if (sender.track.kind == "video") { sender.replaceTrack (frontCameraTrack); } }); }); app.toggleShareScreen = false; });

Todos los que escuchan obtienen el cambio. pero el que transmite el cambio no se refleja. y apagar el video y activar el video, por ejemplo, deja de funcionar.

 if (value === false) { connection.attachStreams.forEach (function (stream) { stream.getVideoTracks (). forEach ((t) => (t.enabled = value)); }); } if (value === true) { connection.attachStreams.forEach (function (stream) { stream.getVideoTracks (). forEach ((t) => (t.enabled = value)); }); }
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!