4

So I found this W3 article on WebRTC while looking for a way to make a video chatting program that works completely in browser without plugins (and noted that the MediaStream seems to only work in Chrome as far as I know).

My question is fairly simple for those who are familiar with this API. All I want to know is where can I find documentation that has example code for a client using this API, or if that doesn't exist, can you provide a working example under the current specifications? Either a demo, or just some "simple" code to connect to a STUN server and demonstrate basic functionality of this API.

Please note that I am not asking for a deprecated client. For example, webkitPeerConnection is deprecated, while webkitRTCPeerConnection as specified in the link, is now the current constructor.

Patrick Roberts
  • 49,224
  • 10
  • 102
  • 153
  • Here is a demo 100% client side: https://webrtc-experiment.appspot.com/ -- code is also available (https://github.com/muaz-khan/WebRTC-Experiment) ....You JUST need to know JavaScript and that's it!....for documentation: IETF RTCWeb drafts are super awesome (http://tools.ietf.org/wg/rtcweb/) .... webrtc.org is a good site! – Muaz Khan Dec 15 '12 at 10:03
  • Not trying to be difficult or offensive, but could you make an answer on here, and include only code relevant to my question? The code in your client you created is quite impressive, but rather messy as the entire client is written in the html file rather than in separate, organized js files. I'd rather not attempt to find what I'm looking for. This may be because I am not familiar with "pubnub." Is it some sort of wrapper for WebSockets? If that's the case, I prefer to use [socket.io](http://socket.io) because the syntax is much more developer-friendly in my humble opinion. – Patrick Roberts Dec 15 '12 at 10:26
  • Though I've not tested the code at this page: https://sites.google.com/site/muazkh/webrtc-order-the-code however may help you. – Muaz Khan Dec 16 '12 at 09:41

1 Answers1

9

I've created a guide to resources: Getting Started With WebRTC.

I've also updated the WebRTC article on HTML5 Rocks.

Above all, I'd recommend reading through the simple RTCPeerCconnection example in the W3C Editor's Draft. This gives a complete but comprehensible outline of RTCPeerConnection, including signalling.

Signalling is the process of exchanging session control messages, network and media information. From a JavaScript perspective, this is probably the hardest part of WebRTC to understand, and the most important to get to grips with.

webkitRTCPeerConnection is the name of the implementation now in Chrome. The prefix will be removed once the standardisation process has stabilised.

MediaStream is implemented in Chrome, Opera and Firefox: see the cross platform example at simpl.info/gum.

Sam Dutton
  • 14,775
  • 6
  • 54
  • 64