Question

If you have 2 users which is on the same webpage or url on different computers, how do you establish a data exchange connection between the two pc? Do you use WebRTC or use json file? Example is CubeSlam.

Was it helpful?

Solution

Cubeslam is a great example of webRTC. It actually has a small note about the technique and informs that they are using webRTC.

webRTC uses peer to peer technique so the stream from your camera never reaches a server. However, to set up the stream you need to do some signaling, and that signaling will be sent via a server.

Example of signaling:

  • Sending SDP messages (Session Description Protocol) with information of i.e. what will be sent in the stream.

  • ICE – Candidates is sent in order to find a good path between the two peers. Making sure there’s no firewalls in the way.

  • Discovery. The unique textstring you see in the URL probably identifies the session and makes it possible for the server to relay the signaling messages to the right peer.

JSONs part in all this is that you can implement the signaling using JSON. But you do not have to.

I think that a good start to know more about webRTC is the slides from the latest Google I/O. It also contains a link to a video of the presntation.

OTHER TIPS

I think they do not make a derect connection between users. A server side support is required i think. In flash it may be FMS etc. If it's a html5 app maybe it use websocket to use ther server side to syn the two user.
PS the WebRTC is supported by very certain kinds of browsers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top