SlideShare a Scribd company logo
1 of 16
HTML5 RTC
Lunch and Learn Series
Lesson 2
Agenda
 HTML5 RTC API Review
 Signaling: session control, network and media information
 RTCPeerConnection API
 RTC Workshop / Demo
HTML5 RTC API Review
• Web Real-Time Communications
• Defines standards to enable browser based sessions
(voice, video, Collaboration, …) without the need of
custom clients or plugins
• Builds on HTLM5 capabilities with JavaScript
• Intended for all browsers to support
– Chrome, Firefox, Safari, Opera, IE …
• Apple (Safari) not at the table
HTML5 RTC API Review
Application Requirements
• Get streaming audio, video or other data.
• Get network information such as IP address and port, and exchange this with other WebRTC
clients (known as peers) to enable connection, even through NATs and firewalls
• Coordinate 'signaling' communication to report errors and initiate or close sessions.
• Exchange information about media and client capability, such as resolution and codecs.
• Communicate streaming audio, video or data.
HTML5 RTC API Review
 MediaStream: get access to data streams, such as from the user's camera and
microphone.
 RTCPeerConnection: audio or video calling, with facilities for encryption and
bandwidth management.
 RTCDataChannel: peer-to-peer communication of generic data.
Available APIs
Signaling
a mechanism to coordinate communication and to send control messages.
Signaling methods and protocols are not specified by WebRTC: signaling is not
part of the RTCPeerConnection API.
Developers can choose whatever messaging protocol they prefer, such as SIP or
XMPP, and any appropriate duplex (two-way) communication channel.
WebSocket is a protocol providing full-duplex communication channels over a
single TCP connection and both SIP and XMPP can be used with a websocket
connection.
Signaling
Signaling
Signaling is used to exchange three types of information:
 Session control messages: to initialize or close communication and report
errors.
 Network configuration: to the outside world, what's my computer's IP address
and port?
 Media capabilities: what codecs and resolutions can be handled by my
browser and the browser it wants to communicate with?
 Signaling makes use of the SDP for gathering the network addresses and port
numbers that can be used for the media exchange.
 Once each browser has sent its own session description object and also
received the session description from the other peer’s browser the media
exchange can begin between the clients
Internetwork connectivity
 Network Address Translator (NAT) is a device made for assigning public
addresses to devices inside a private local network.
 STUN protocol : STUN stands for Session Traversal Utilities for NAT, and when
a client wants to know their public IP address they ask the STUN server.
 TURN protocol : If it was not possible for STUN to provide the host with a
public IP address when requested, then TURN will address this problem by
relaying the traffic through the cloud.
 ICE protocol : ICE finds communication paths between peers. ICE first
requests the end user's public IP address from the host's operating system.
When ICE finds an address, it adds this to the RTCPeerConnection object.
RTCPeerConnection API
RTCPeerConnection API
 Basic RTCPeerConnection usage involves negotiating a connection between your
local machine and a remote one by generating Session Description Protocol to
exchange between the two.
var pc = new RTCPeerConnection();
 The caller starts the process by sending an offer to the remote device, which
responds by either accepting or rejecting the connection request.
pc.createOffer(function(offer) {
pc.setLocalDescription(new RTCSessionDescription(offer), function() {
// send the offer to a server to be forwarded to the friend you're calling.
}, error);
}, error);
RTCPeerConnection API
RTCPeerConnection API
 On the opposite end, the remote device will receive the offer from the server
using whatever protocol is being used to do so.
 An RTCSessionDescription object is created and set up as the remote
description by calling RTCPeerConnection.setRemoteDescription().
 Then an answer is created using RTCPeerConnection.createAnswer() and sent
back to the server, which forwards it to the caller.
 On the original machine, the response is received. Once that happens, call
RTCPeerConnection.setRemoteDescription() to set the response as the remote
end of the connection.
RTCPeerConnection API
RTC Workshop / Demo
 Create a Video chat application using the RTCPeerConnection API.
Thanks Folks 

More Related Content

What's hot

Protocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol SuiteProtocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol SuiteAtharaw Deshmukh
 
Lec 2(intoduction of computer networkes)
Lec 2(intoduction of computer networkes)Lec 2(intoduction of computer networkes)
Lec 2(intoduction of computer networkes)maamir farooq
 
Nachos Theoretical assigment 3
Nachos Theoretical assigment 3Nachos Theoretical assigment 3
Nachos Theoretical assigment 3colli03
 
WebRTC Introduction & Basics
WebRTC Introduction & BasicsWebRTC Introduction & Basics
WebRTC Introduction & BasicsMuhammad Ali
 
Introduction of tcp, ip & udp
Introduction of tcp, ip & udpIntroduction of tcp, ip & udp
Introduction of tcp, ip & udprahul kundu
 
Lec 12(Transport Layer)
Lec 12(Transport Layer)Lec 12(Transport Layer)
Lec 12(Transport Layer)maamir farooq
 
User Datagram protocol For Msc CS
User Datagram protocol For Msc CSUser Datagram protocol For Msc CS
User Datagram protocol For Msc CSThanveen
 
10.connection establishement procedure
10.connection establishement procedure10.connection establishement procedure
10.connection establishement procedurePramod Rathore
 
Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureMuhammad Ali
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)Kruti Niranjan
 
Tcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport LayerTcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport Layertmavroidis
 
Tcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication headerTcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication headerFaizan Shaikh
 
web communication protocols in IoT
web communication protocols in IoTweb communication protocols in IoT
web communication protocols in IoTFabMinds
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP PresentationHarish Chand
 

What's hot (20)

Protocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol SuiteProtocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol Suite
 
Lec 2(intoduction of computer networkes)
Lec 2(intoduction of computer networkes)Lec 2(intoduction of computer networkes)
Lec 2(intoduction of computer networkes)
 
Tcp Udp Notes
Tcp Udp NotesTcp Udp Notes
Tcp Udp Notes
 
Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)
 
Nachos Theoretical assigment 3
Nachos Theoretical assigment 3Nachos Theoretical assigment 3
Nachos Theoretical assigment 3
 
WebRTC Introduction & Basics
WebRTC Introduction & BasicsWebRTC Introduction & Basics
WebRTC Introduction & Basics
 
Introduction of tcp, ip & udp
Introduction of tcp, ip & udpIntroduction of tcp, ip & udp
Introduction of tcp, ip & udp
 
Introduction to TCP/IP
Introduction to TCP/IPIntroduction to TCP/IP
Introduction to TCP/IP
 
Lec 12(Transport Layer)
Lec 12(Transport Layer)Lec 12(Transport Layer)
Lec 12(Transport Layer)
 
User Datagram protocol For Msc CS
User Datagram protocol For Msc CSUser Datagram protocol For Msc CS
User Datagram protocol For Msc CS
 
Tcp Udp
Tcp UdpTcp Udp
Tcp Udp
 
10.connection establishement procedure
10.connection establishement procedure10.connection establishement procedure
10.connection establishement procedure
 
Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & Future
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
 
Tcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport LayerTcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport Layer
 
Tcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication headerTcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication header
 
web communication protocols in IoT
web communication protocols in IoTweb communication protocols in IoT
web communication protocols in IoT
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
 
Udp vs-tcp
Udp vs-tcpUdp vs-tcp
Udp vs-tcp
 

Similar to Html5 rtc 2 (20)

Protocols in computer network
Protocols in computer network   Protocols in computer network
Protocols in computer network
 
WebRTC Seminar Report
WebRTC  Seminar ReportWebRTC  Seminar Report
WebRTC Seminar Report
 
Transport Layer
Transport LayerTransport Layer
Transport Layer
 
Final networks lab manual
Final networks lab manualFinal networks lab manual
Final networks lab manual
 
WebRTC
WebRTCWebRTC
WebRTC
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
10. tcp ip and do d model
10. tcp ip and do d model10. tcp ip and do d model
10. tcp ip and do d model
 
Protocol For Streaming Media
Protocol For Streaming MediaProtocol For Streaming Media
Protocol For Streaming Media
 
WebRTC
WebRTCWebRTC
WebRTC
 
Mcse question
Mcse questionMcse question
Mcse question
 
Java Network Programming.pptx
Java Network Programming.pptxJava Network Programming.pptx
Java Network Programming.pptx
 
WebRTC in action
WebRTC in actionWebRTC in action
WebRTC in action
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat application
 
Md13 networking
Md13 networkingMd13 networking
Md13 networking
 
Aplication and Transport layer- a practical approach
Aplication and Transport layer-  a practical approachAplication and Transport layer-  a practical approach
Aplication and Transport layer- a practical approach
 
CCNA v6.0 ITN - Chapter 09
CCNA v6.0 ITN - Chapter 09CCNA v6.0 ITN - Chapter 09
CCNA v6.0 ITN - Chapter 09
 
Html web rtc
Html web rtcHtml web rtc
Html web rtc
 
Networking in python by Rj
Networking in python by RjNetworking in python by Rj
Networking in python by Rj
 
Basic to advance protocols
Basic to advance protocolsBasic to advance protocols
Basic to advance protocols
 
Remote access service
Remote access serviceRemote access service
Remote access service
 

Recently uploaded

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Recently uploaded (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Html5 rtc 2

  • 1. HTML5 RTC Lunch and Learn Series Lesson 2
  • 2. Agenda  HTML5 RTC API Review  Signaling: session control, network and media information  RTCPeerConnection API  RTC Workshop / Demo
  • 3. HTML5 RTC API Review • Web Real-Time Communications • Defines standards to enable browser based sessions (voice, video, Collaboration, …) without the need of custom clients or plugins • Builds on HTLM5 capabilities with JavaScript • Intended for all browsers to support – Chrome, Firefox, Safari, Opera, IE … • Apple (Safari) not at the table
  • 4. HTML5 RTC API Review Application Requirements • Get streaming audio, video or other data. • Get network information such as IP address and port, and exchange this with other WebRTC clients (known as peers) to enable connection, even through NATs and firewalls • Coordinate 'signaling' communication to report errors and initiate or close sessions. • Exchange information about media and client capability, such as resolution and codecs. • Communicate streaming audio, video or data.
  • 5. HTML5 RTC API Review  MediaStream: get access to data streams, such as from the user's camera and microphone.  RTCPeerConnection: audio or video calling, with facilities for encryption and bandwidth management.  RTCDataChannel: peer-to-peer communication of generic data. Available APIs
  • 6. Signaling a mechanism to coordinate communication and to send control messages. Signaling methods and protocols are not specified by WebRTC: signaling is not part of the RTCPeerConnection API. Developers can choose whatever messaging protocol they prefer, such as SIP or XMPP, and any appropriate duplex (two-way) communication channel. WebSocket is a protocol providing full-duplex communication channels over a single TCP connection and both SIP and XMPP can be used with a websocket connection.
  • 8. Signaling Signaling is used to exchange three types of information:  Session control messages: to initialize or close communication and report errors.  Network configuration: to the outside world, what's my computer's IP address and port?  Media capabilities: what codecs and resolutions can be handled by my browser and the browser it wants to communicate with?  Signaling makes use of the SDP for gathering the network addresses and port numbers that can be used for the media exchange.  Once each browser has sent its own session description object and also received the session description from the other peer’s browser the media exchange can begin between the clients
  • 9. Internetwork connectivity  Network Address Translator (NAT) is a device made for assigning public addresses to devices inside a private local network.  STUN protocol : STUN stands for Session Traversal Utilities for NAT, and when a client wants to know their public IP address they ask the STUN server.  TURN protocol : If it was not possible for STUN to provide the host with a public IP address when requested, then TURN will address this problem by relaying the traffic through the cloud.  ICE protocol : ICE finds communication paths between peers. ICE first requests the end user's public IP address from the host's operating system. When ICE finds an address, it adds this to the RTCPeerConnection object.
  • 11. RTCPeerConnection API  Basic RTCPeerConnection usage involves negotiating a connection between your local machine and a remote one by generating Session Description Protocol to exchange between the two. var pc = new RTCPeerConnection();  The caller starts the process by sending an offer to the remote device, which responds by either accepting or rejecting the connection request. pc.createOffer(function(offer) { pc.setLocalDescription(new RTCSessionDescription(offer), function() { // send the offer to a server to be forwarded to the friend you're calling. }, error); }, error);
  • 13. RTCPeerConnection API  On the opposite end, the remote device will receive the offer from the server using whatever protocol is being used to do so.  An RTCSessionDescription object is created and set up as the remote description by calling RTCPeerConnection.setRemoteDescription().  Then an answer is created using RTCPeerConnection.createAnswer() and sent back to the server, which forwards it to the caller.  On the original machine, the response is received. Once that happens, call RTCPeerConnection.setRemoteDescription() to set the response as the remote end of the connection.
  • 15. RTC Workshop / Demo  Create a Video chat application using the RTCPeerConnection API.

Editor's Notes

  1. The Session Initiation Protocol (SIP) is a communications protocol for signaling and controlling multimedia communication sessions. Internet telephony for voice and video calls, as well as instant messaging, over Internet Protocol (IP) networks. The protocol defines the messages that are sent between endpoints, which govern establishment, termination and other essential elements of a call. SIP can be used for creating, modifying and terminating sessions consisting of one or several media streams. SIP is an application layer protocol designed to be independent of the underlying transport layer. It is a text-based protocol, incorporating many elements of the Hypertext Transfer Protocol (HTTP) and the Simple Mail Transfer Protocol(SMTP).[1] Extensible Messaging and Presence Protocol (XMPP) is a communications protocol for message-oriented middleware based on XML (Extensible Markup Language).[1] It enables the near-real-time exchange of structured yet extensible data between any two or more network entities
  2. This makes it more complicated to route a peer­to­peer communication between web browsers. The devices inside a private network holds private addresses, and it is not possible to make a connection with someone outside the private network without a public address. The STUN server responds with the public IP address and now does the WebRTC application know its public address and if the remote peer has also obtained its public IP address, the clients can send media to each other through their remote peer’s NAT. And this will always work since it is out in the public internet and therefore anybody can contact it. The reason this is not the first option to use is because this method consumes a lot of bandwidth and STUN is a cheaper option. m, but if the host is behind a NAT then that method will fail. So the second strategy will be to employ a STUN server and ask for the address. If that also fails then the last remaining method ICE will use is a TURN server to relay the communication ICE also checks the connectivity between the peers.
  3. If you are the one initiating the call, you would use navigator.getUserMedia() to get a video stream, then add the stream to the RTCPeerConnection. Once that's been done, call RTCPeerConnection.createOffer() to create an offer, configure the offer, then send it to the server through which the connection is being mediated.
  4. Once the offer arrives, navigator.getUserMedia() is once again used to create the stream, which is added to the RTCPeerConnection.