Real-time video communication via WebRTC (I.)

Source: Internet
Author: User

Real-time video communication via WebRTC (I.)

Real-time video communication via WEBRTC (II.)

Real-time video communication via WEBRTC (iii)

WebRTC, a name derived from the abbreviation of Web real-time communication (Web real-time communication), is an API that enables Web browsers to make real-time voice conversations or video conversations. It opened its open source on June 1, 2011 and was included in the World Wide Web Consortium's recommendations with the support of Google, the Mozilla Foundation and Opera.

No plug-in real-time communication required

Imagine if your phone, TV, or computer can communicate through a single platform, and imagine that you can easily join video chat and peer-to-peer data sharing in your Web app, and aren't you excited? This is WebRTC.

Want to have a try? WebRTC is now integrated into Chrome,opera and Firefox, and you can try this app:

Apprtc.appspot.com:

    1. Open apprtc.appspot.com in Chrome, opera, or Firefox.

    2. Click the Allow button to allow the app to use your webcam.

    3. On the New tab, open the URL of the body display even on another computer.

Here is a specific tutorial for this application: later in this article.

Begin

If you don't have time to read this series of articles and want to encode directly, you can do this:

    1. Take a look at Gooogle's slide show about WebRTC (here)

    2. You have not used Getusermedia, you have to learn it first, tutorial: HTML5 Rocks article, Demo:simpl.info/gum.

    3. Master rtcpeerconnection API, tutorial: simple example below, DEMO:SIMPL.INFO/PC,.

    4. Learn about WEBRTC implementations, firewalls, and Nat forwarding, tutorial: apprtc.appspot.com.

    5. WebRTC shooting with a head Photo: gbtags.com/gb/share/2491.htm

Or you can jump straight to this step: step-by WebRTC Codelab Learn how to build a complete video chat application, including a simple signal server.

A little story about WEBRTC.

In fact, the ultimate challenge of a web development is to communicate in real-time through audio and video, and video communication should be as natural as text communication, without which our ability to innovate in user interaction is constrained.

In the past, real-time communications were complex and required very rich audio and video technology to be developed. The complete implementation of real-time communication requires the consolidation of a large amount of data and services, which is particularly difficult to implement on the Web.

2008, Gmail video chat fire. 2011 Google released Hangouts, acquired Gips,gips is a RTC direction of the company, and then open up its related technology, in the same year in May, Ericsson built the first WEBRTC implementation.

Hangouts, Google's 2013 Google I/O conference, released a unified messaging service that integrates products such as Google Talk, the Google + Messenger, and the Hangouts video chat service. The new hangouts is based entirely on cloud computing technology and will be a pillar of other Google services. Google is preparing for the future, although Google is slow in its popular mobile messaging app market. On the face of it, Hangouts is another messaging app like WhatsApp and Facebook Messenger.

WEBRTC is currently used for real-time communication, free video plug-ins, audio and video data transfer. Here are the actual applications:

    • Many Web services already use RTC, but all need to download plugins or native apps such as Skype,facebook and Google Hangouts.

    • Downloading and installing the update plugin is cumbersome.

    • Plugins are not easy to identify problems, testing is difficult, most of them need authorization, the development cost is too high.

Security

Here are a few security issues that can occur with real-time communication applications:

    • Unencrypted media traffic can be acquired in the browser or in communication.

    • The app may record video and other information without the user's knowledge.

    • Malicious software or viruses may be installed in an obscure plugin or application.

WebRTC avoids these problems through various features:

    • WebRTC implements many user security protocols, such as DTLS and SRTP.

    • Encode and encrypt the data stream and semaphore.

    • 。 WebRTC is not a plugin that can run in a browser sandbox, and components do not need to be installed separately.

    • Cameras and mobile phones must be strictly licensed and can only be called when the user interface is displayed.

A detailed discussion of WebRTC security is beyond the scope of this article, and if you want to learn more about this, take a look at the WebRTC security Architecture provided by the IETF.

Developer Tools
      • when the WEBRTC session is created, Chrome://webrtc-internals (opera://webrtc-internals ) provides session-specific data flow and graphs:

        Chrome://webrtc-internals

    • Interop notes across Browsers

    • Adapter.js is a JavaScript WEBRTC adaptation, contributed by Google, to address changes in browser differentiation specifications.

    • To learn more about WEBRTC semaphores, you can view the output date to by apprtc.appspot.com.

    • If you feel the trouble can be used WebRTC framework even the complete WebRTC service.

    • Chrome bugsbug Report: Crbug.com/new. opera:bugs.opera.com/wizard/. Firefox:bugzilla.mozilla.org.

Where to use WEBRTC

WEBRTC has the following three APIs:

    • MediaStream (alias Getusermedia)

    • Rtcpeerconnection

    • Rtcdatachannel

Getusermedia can be implemented in Chrome, Opera and Firefox. You can take a look at this cross-platform Demo:simpl.info/gum and Chris Wilson example and let Getusermedia as input to the audio.

rtcpeerconnection is used in chrome and Android devices, and after several iterations rtcpeerconnection now supports Chrome and Opera As Webkitrtcpeerconnection,firefox as mozrtcpeerconnection.

Rtcdatachannel supports more than 22 versions of Chrome, Opera 18 and Firefox.

It is often reported that a platform supports WEBRTC, generally saying that they support Getusermedia, and that they do not support other RTC components, which need to be understood first when developing.

My first WEBRTC project

The WebRTC project needs to do several things:

    • Data streams to audio, video, or other data.

    • Get network information, such as IP addresses and ports, to exchange data over the network and other WEBRTC clients to resolve NAT forwarding problems on the firewall.

    • Coordinate signals to report errors, start or close sessions.

    • Exchange media and client information to handle issues such as resolution and codec. Dia and client capability, such as resolution and codecs.

    • Data flow letter.

To achieve communication between data streams, WEBRTC implements the following interfaces:

    • MediaStream: Get data streams, such as from cameras and mobile phones.

    • Rtcpeerconnection: Audio and video calls, device encryption, and bandwidth management.

    • Rtcdatachannel: Point-to-point communication.

Summarize

You should probably understand WebRTC 's summary. In the next article, we will specifically explain the process of building a WebRTC for these three APIs.

Real-time video communication via WebRTC (I.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.