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
peerjs agregando confirmación para aceptar o rechazar la próxima llamada

Estoy desarrollando un proyecto de django e incluyo una videollamada con el uso de peerjs. Entonces, cuando el usuario llama al otro lado, no aparece la confirmación. ¿Alguien puede ayudarme? (En realidad, el mismo código funcionó ayer, pero hoy no cambié nada). no funciona ahora)

 var currentUserSlug = JSON.parse(document.getElementById('requestUserUsername').textContent); var other_user_slug = JSON.parse(document.getElementById('other_user').textContent); var video1=document.getElementById("video1"); var video2=document.getElementById("video2"); var camera=document.getElementById("camera"); var microfone=document.getElementById("microfone"); var isMicOpen=true; var isCamOpen=true; var side=window.location.search.substr(1).split("=")[1]; const peer = new Peer(currentUserSlug, { host: 'localhost', port: 9000, path: '/' }) navigator.mediaDevices.getUserMedia({audio:true,video:true}) .then(function(stream){ video2.srcObject=stream video2.play() video2.muted=true if(side=="caller"){ var call=peer.call(other_user_slug,stream) call.on("stream",function(remoteStream){ video1.srcObject=remoteStream video1.play() }) }else{ peer.on("call",function(call){ var resCall=confirm("Videocall incoming, do you want to accept it ?"); if(resCall){ call.answer(stream) call.on("stream",function(remoteStream){ video1.srcObject=remoteStream video1.play() }); } else{ console.log("declined."); } }) } })
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!