Jump to content

WebRTC P2P connection


RikyTres

Recommended Posts

Hi everyone. I need to create a webApp for video call between two computers using a browser without plug-in. I have to use WebRTC to make this. While searching information about this, I found out a lot of exemples and demos, but i don't understand how the connection works.What's kind of parameters I have to pass to RTCPeerConnection() to create a connection between two my computer both in same LAN? Thanks for the help.

Link to comment
Share on other sites

Since this is so new, it's probably best to just inspect their demo and see what it's doing. You can put a breakpoint on the line where they create the RTCPeerConnection object to see what parameters are being passed to it, for example.

  • Like 1
Link to comment
Share on other sites

Since this is so new, it's probably best to just inspect their demo and see what it's doing. You can put a breakpoint on the line where they create the RTCPeerConnection object to see what parameters are being passed to it, for example.
Thanks for the quickly answer!I never thought to use a breakpoint... I'm gonna try!
Link to comment
Share on other sites

I keep trying to understand! I found out some problems with JavaScript syntax.Could someone explain me this code portion?

{...var pc1 = new RTCPeerConnection(servers);var pc2 = new RTCPeerConnection(servers);...pc1.createOffer(gotDescription1);	//why is gotDescription1 invoked without any parameter?...} function gotDescription1(desc){  pc1.setLocalDescription(desc);  trace("Offer from pc1 \n" + desc.sdp);  pc2.setRemoteDescription(desc);  pc2.createAnswer(gotDescription2);}

I don't understand what is the values of "desc" parameter in the gotDescription1(desc){}

Link to comment
Share on other sites

The line with the comment does not execute the function, it passes the function to whatever createOffer is. createOffer does something with the function, maybe it sets the function as a callback for something else or just executes it. desc looks like it's an object, but that's all I could say without setting a breakpoint in that function and looking at it, or finding where the function gets called from.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...