Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

116
Vistas
Variable pointing to null again instead of pointing to object

In the below given code I have created rtcobj variable at global scope using var datatype(initially null assigned),but when I am assigning the object RTCPeerConnection(configuration) the variable points to RTCPeerConnection(configuration) as long as the function lasts, but afterwards rtcobj starts pointing to null again. Why is it happening so I am not getting (Means why rtcobj points to null again instead of rtc object).

navigator.webkitGetUserMedia({video:true,audio:true},function(mystream){
                        localvideo.srcObject=mystream;
                        conn.mystream=mystream
                        var configuration = { 
                            "iceServers": [{ "url": "stun:stun2.1.google.com:19302" }]
                        };
                        rtcobj=new RTCPeerConnection(configuration)
                        console.log(rtcobj)
                        rtcobj.addStream(mystream);
                        rtcobj.onaddstream=function(event){
                            otherpeerspan.style.display="none"
                            muteunmute.style.display="block"
                            remotevideo.srcObject=event.stream
                        } 
                        
                        rtcobj.onicecandidate=function(event){
                            if(event.candidate){
                                send({ 
                                    type: "candidate", 
                                    candidate: event.candidate 
                                }); 
                            }
                        }
                    },function (error) { 
                        console.log(error); 
                        }
                    )
                                                                                                                            
                }
                console.log("rtc:"+rtcobj)
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda