HTML5 Real Time Communication (RTC)

What is RTC?

  • RTC was introduced by the World Web Consortium (W3C).
  • RTC is abbreviated as Real Time Communication.
  • It supports the browser for applications like voice calling, video chat and P2P file sharing.
There are three API's which are implemented by the RTC:

MediaStream – It gives access to the user's camera and microphone.
RTCPeerConnection – It gives access to the audio and video calling facility.
RTCDataChannel – it gives access for peer to peer communication.

Media Stream

  • Synchronized streams of media are represented by the MediaStream.
  • It contains the stream.getAudioTracks() and the stream.VideoTracks().
  • An empty array is returned and it will also check the video stream if there are no audio tracks.
  • If there is a webcam connected to the stream.getVideoTracks() method then it will return an array of the MediaStreamTrack which represents the stream from the webcam.
  • Screen capturing can be done in the chrome browser with the mediaStreamSource which requires HTTPS.

Session Control, Network & Media Information

  • Peer-to-peer communication is required between the browsers by the Web RTC.
  • Mechanisms such as signaling, network information, session control and media information.
  • Any mechanism can be chosen by the web developer to communicate between browsers such as SIP or XMPP or two way communications.