4
头图

Author: WebRTC Team

Preface

In recent years, real-time audio and video communication applications have shown a trend of explosion. Behind these real-time communication technologies, there is a technology that must be mentioned-WebRTC.

In January of this year, WebRTC was published as an official standard by W3C and IETF. According to a report by the research organization GrandViewReseach, predicts that the global WebRTC market size will reach 21.023 billion U.S. dollars in 2025. Compared with the market size of 2.3 billion U.S. dollars in 2019, the 5-year compound annual growth rate is 43.6% .

This series of content will discuss with you, why is WebRTC favored by developers and enterprises? How will WebRTC develop in the future? And how does Agora perform secondary development based on WebRTC, and how will it support the WebRTC NV version?


Online meetings, online education, online interviews, online social interactions, online medical care, financial securities online account opening, smart homes, etc., have become a very familiar part of modern people’s lives. Transforming common offline scenes to online, people are not enough You can experience the above scenes when you go out. These real-time interactive scenes have changed our original way of life to a large extent.

If we go back to 10 years ago, that is, when 4G is about to be commercialized, almost all media and technologies are emphasizing that 4G can watch high-definition video, but most of them are focused on discussing how convenient it is to watch videos on mobile phones. People predicted the complete explosion of short videos; most people knew that the upload speed of 4G could be used for live video broadcasting, but the vision at that time was more applied to the field of professional news. They did not expect the coming of this era where all people can live broadcast; Most of the vision of video conferencing stays on the needs of transnational office, but I did not expect that just last year, online office has almost become a daily routine for every office worker.

In the past ten years, how has the dailyization of real-time interactive scenes been achieved step by step?

From around 2010, real-time communication can only use proprietary software, plug-ins or Adobe Flash for real-time communication; in 2013, the first cross-browser video call was made between Chrome and Firefox; in 2014, the first cross-browser data transfer Realized, real-time communication through the client opened an emerging trend...and today, it is called WebRTC, we are in Chrome, Mozilla Firefox, Opera, Safari, Edge, iOS and Android real-time every day Use it in interactive scenes.

What is WebRTC

WebRTC is an open source project initiated by Google, Mozilla, Opera, etc., whose name is derived from the abbreviation of Web Real-Time Communication. Therefore, it is not difficult to see that the initial goal of this technology is to prepare for the realization of free real-time audio and video transmission on the browser.

"In fact, WebRTC has different meanings in different scenarios. It can represent Google's open source WebRTC project, it can also represent the WebRTC standard formulated by the W3C (World Wide Web Consortium) working group, and it can also represent WebRTC in the browser. Interface, we call them WebRTC technology collectively." [1] Most of the time, for developers, WebRTC is a set of W3C Javascript API that supports web browsers for real-time audio and video conversations. It includes audio and video capture, encoding and decoding. , Network transmission, display and other functions.

Since almost all mainstream browsers support WebRTC standard API, it also makes it possible to communicate between browsers without plug-in audio and video, which greatly reduces the threshold for audio and video development. Developers only need to call WebRTC API to quickly build Audio and video applications.

webrtc 脉络_画板 1(1).png

Why developers like to use WebRTC

"The mission of WebRTC is to enable rich, high-quality RTC applications to be developed for browsers, mobile platforms, and IoT devices, and to allow everyone to communicate through a common set of protocols."

What problem does WebRTC solve?

Before WebRTC, the difficulty of RTC communication for developers mainly came from the complexity of the Internet, the sensitivity of delay, the low fluency and definition of real-time audio and video, and the high operating cost. But these problems have been better resolved after the emergence of WebRTC:

1. The Internet is complex

Different NATs and firewalls have brought great challenges to the establishment of media P2P. The emergence of WebRTC provides end-to-end direct communication for browsers, allowing developers to easily realize this connection. At the same time, there is a P2P open source project libjingle in WebRTC, which supports STUN, TURN and other protocols.

2. Delay sensitive

In the early RTC technology, TCP (Transmission Control Protocol) can only use UDP for transmission due to its own mechanism defects, but this requires developers to solve problems such as retransmission and disorder. WebRTC provides NACK and FEC technologies, which eliminates the need for routing through the server, reducing latency and bandwidth consumption. Direct communication can increase the speed of data transfer and file sharing.

3. Fluency

The Internet network is unstable, and some small operators, in particular, cannot guarantee sufficient bandwidth during peak traffic usage periods. A set of adaptive algorithms is needed to deal with problems such as network congestion and smooth transmission. TCC + SVC + PACER + JitterBuffer technical support is provided in WebRTC.

4. Clear voice

Due to the complex terminal equipment and environment, there will be noise and echo interference. At this time, WebRTC provides 3A algorithm + NetEQ, which greatly improves the sound processing and interactive experience in the real-time environment.

For developers or enterprises, the process of using WebRTC only needs to download a WebRTC-compatible browser and use it. Audio and video applications can be easily embedded into any website without additional software, plug-ins or continuous server participation. And it is connected via the Internet, which greatly saves development time and cost.

At present, mainstream browsers such as Microsoft Edge, Google Chrome, Mozilla Firefox, Safari, Safari, Opera, Vivaldi, etc. have already supported WebRTC.

Is it safe to use WebRTC?

As an open source technology, WebRTC can be used for free on any web browser and is not restricted by plug-ins. So, at this time, someone may ask, is it safe to use WebRTC? Will there be malicious access to my user data or private network when using WebRTC?

Rest assured, in terms of security, WebRTC has also made an optimized design: All WebRTC media data must be encrypted .

Since WebRTC is not a plug-in, there is no need to install other plug-ins, so all applications can run in the browser's sandbox, and there is no need to create additional processes. Because of this, WebRTC effectively prevents malicious software from entering the user's system. In any real-time communication application, the process of data transmission may increase security risks. Therefore, encryption is a mandatory function of WebRTC and is enforced on all media data. 【2】

WebRTC uses two standardized encryption protocols:

  • Datagram Transport Layer Security (DTLS)
  • Standardized protocol built into the browser. It is data stream encryption based on the Transport Layer Protocol (TLP);
  • Because DTLS uses User Data Protocol (UDP), it retains the semantics of transmission;
  • It is an extension of the Secure Sockets Layer (SSL), and any SSL protocol can be used to protect WebRTC data, allowing end-to-end encryption.

Secure Real-Time Transport Protocol (SRTP)

  • Used for media stream encryption;
  • It is an extension of the Real-Time Transport Protocol (RTP), which does not have any built-in security mechanism;
  • Provides encryption, integrity assurance, and message authentication for the Real-Time Transport Protocol (RTP).

(* But the SRTP protocol also has some of its shortcomings. For example, although it provides encryption for RTP packets, it does not encrypt the header.)

In our daily use of the Internet to download applications, movies, or transfer information/files via email, there may actually be a risk of malicious intrusion. However, the WebRTC technology through the above-mentioned standards can effectively protect the transmission of sensitive data and provide a guarantee for a secure real-time communication environment.

Can WebRTC be consumed directly?

WebRTC is a far-reaching effort of the Internet industry in real-time communication, which greatly reduces the threshold for developers to implement real-time audio and video communication functions. Do I have a good idea and I can directly use WebRTC for development and commercial use? (Rubbing hands 😄...) Unfortunately, the answer is no.

Since the transmission of WebRTC is based on the public Internet, and the public Internet is not designed for real-time communication, the development of WebRTC will be useful in terms of network protocol, cross-regional bandwidth, cross-operator, user equipment, network architecture, document support, etc. Containment, which will lead to real-time audio and video transmission quality can not be effectively guaranteed.

details on the advantages and disadvantages of WebRTC, please refer to: WebRTC status and advantages and disadvantages, a must-see open source project for audio and video communication

Therefore, it can be said that if WebRTC is directly used for commercial use, it is almost impossible. The current common solution is self-research, secondary custom development according to its own business scenarios, or simpler use of third-party SDKs. ( Agora WebSDK is a collection of APIs based on WebRTC encapsulation. It is extremely simple and more friendly to developers. A simple demo can be completed and within ten lines. 160a4c590d0cdf Click [View Details] )

We will share with you in the follow-up content of this series about how WebRTC performs secondary custom development and the best practice content of WebRTC.

Stay tuned~

references:

[1] Mao Yujie. 2018. Attack on WebRTC: Why do we need it? -InfoQ. [online] Infoq.cn. Available at: https://www.infoq.cn/article/why-do-we-need-webrtc [Accessed 28 April 2021].

【2】Grandviewresearch.com. 2021. Web Real-Time Communication Market Report, 2020-2027. [online] Available at: https://www.grandviewresearch.com/industry-analysis/web-real-time-communication-market [Accessed 18 May 2021].


RTE开发者社区
647 声望966 粉丝

RTE 开发者社区是聚焦实时互动领域的中立开发者社区。不止于纯粹的技术交流,我们相信开发者具备更加丰盈的个体价值。行业发展变革、开发者职涯发展、技术创业创新资源,我们将陪跑开发者,共享、共建、共成长。


引用和评论

0 条评论