您的位置:首页 > 其它

WebRTC实时通信系列教程1 介绍

2017-08-05 00:03 363 查看
【转载请注明出处: http://blog.csdn.net/leytton/article/details/76696372

 PS:如果本文对您有帮助,请点个赞让我知道哦~



《WebRTC实时通信系列教程》翻译自《Real time communication with WebRTC

示例代码下载http://download.csdn.net/detail/leytton/9923708

WebRTC实时通信系列教程1 介绍

WebRTC实时通信系列教程2 概述

WebRTC实时通信系列教程3 获取示例代码

WebRTC实时通信系列教程4 从摄像头获取视频流

WebRTC实时通信系列教程5 RTCPeerConnection传输视频

WebRTC实时通信系列教程6 使用RTCDataChannel传输数据

WebRTC实时通信系列教程7 使用Socket.IO搭建信令服务器交换信息

WebRTC实时通信系列教程8 打通P2P连接和信令通信

WebRTC实时通信系列教程9 数据通道图片传输

WebRTC实时通信系列教程10 恭喜完成本系列课程

一、译文


1. 简介

WebRTC是一个在网页和本地应用中支持音视频和数据实时通信的开源项目。

WebRTC 有一些 JavaScript 接口 — 点击链接查看案例.

getUserMedia(): 获取音视频.
MediaRecorder: 记录音频和视频.
RTCPeerConnection: 客户端之间传输音视频.
RTCDataChannel: 客户端之间传输数据.

2、在哪里可以使用WebRTC?

Firefox, Opera 和 Chrome 的桌面、手机端浏览器都支持WebRTC. 也可以在本地iOS和Android应用中使用.

3、什么是信令传输?

WebRTC 在浏览器之间使用RTCPeerConnection交流数据, 但还需要一种机制来协调沟通和发送控制消息, 这一过程称之为信令传输. WebRTC并没有指定信令传输的方法和协议 . 在这次编程实验中我们使用Node, 但也有其他选择 many alternatives.

4、什么是 STUN 和 TURN?

WebRTC 被设计为点对点工作模式, 所以用户之间是尽可能地通过最短路线进行连接. 然而, 在现实世界当中: 客户端应用需要穿透 NAT 网关 和防火墙, 并且点对点网络需要握手来防止直接连接失败.在这一过程中, WebRTC APIs 使用STUN服务器来获取计算机IP地址和TURN服务器来保证点对点连接成功.详情请看WebRTC
in the real world .

WebRTC是否安全?

WebRTC所有组件是强制加密的, 并且它的 JavaScript 接口 只能用于安全来源 (HTTPS 或 localhost). 信令传输机制并不是WebRTC标准,所以是否采用安全协议取决于你.

查看更多资源 webrtc.org/start.

二、原文

摘自https://codelabs.developers.google.com/codelabs/webrtc-web/#0


1. Introduction

WebRTC is an open source project to enable realtime communication of audio, video and data in Web and native apps.
WebRTC has several JavaScript APIs — click the links to see demos.

getUserMedia()
:
capture audio and video.
MediaRecorder
:
record audio and video.
RTCPeerConnection
:
stream audio and video between users.
RTCDataChannel
:
stream data between users.


Where can I use WebRTC?

In Firefox, Opera and in Chrome on desktop and Android. WebRTC is also available for native apps on iOS and Android.


What is signaling?

WebRTC uses RTCPeerConnection to communicate streaming data between browsers, but also needs a mechanism to coordinate communication and to send control messages, a process known as
signaling. Signaling methods and protocols are not specified by WebRTC. In this codelab we use Node, but there are many
alternatives.


What are STUN and TURN?

WebRTC is designed to work peer-to-peer, so users can connect by the most direct route possible. However, WebRTC is built to cope with real-world networking: client applications need
to traverse NAT gateways and firewalls, and peer to peer networking needs fallbacks in case direct connection fails. As part of this process,
the WebRTC APIs use STUN servers to get the IP address of your computer, and TURN servers to function as relay servers in case peer-to-peer communication fails. (WebRTC
in the real world explains in more detail.)


Is WebRTC secure?

Encryption is mandatory for all WebRTC components, and its JavaScript APIs can only be used from secure origins (HTTPS or localhost). Signaling mechanisms aren't defined by WebRTC standards,
so it's up to you make sure to use secure protocols.
Looking for more? Check out the resources at webrtc.org/start.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: