WebRTC - help me understand a few concepts

前端 未结 2 725
粉色の甜心
粉色の甜心 2020-12-30 16:22

I\'m new to WebRTC, actually just heard about it a few days ago and I\'ve read a lot about it. However, I still have a few questions.

What do I need to explore the u

2条回答
  •  孤独总比滥情好
    2020-12-30 17:12

    What do I need to explore the usage of WebRTC? E.g.: do I need a server, any libraries etc.? I'm aware that new version of Chrome and Firefox support WebRTC, but besides these two browsers, is there anything else that is necessary?

    WebRTC it is JavaScript API for web developers which can be used for audio and video streaming.

    But there are 2 notices:

    1. You need a signaling path. For example, if your first user is Alice using Firefox and second user is Bob using Chrome, they should negotiate used codecs and streams. WebRTC does not offer the signalling implementation. So you need to implement the signaling yourself. It is quite simple. You need to send SDP(stream config) to participant and receive an SDP answer. You can use plain HTTP via apahe server or use Websockets or any other transport to negotiate SDP. So, it seems you need an intermediary signaling server workning with websockets or HTTP/HTTPS.

    2. Once you negotiated the streams you are sending your audio or video stream, but the distanation user might have a simmetric NAT. It means that you stream will not be delivered to the target user. In such situation you need a TURN server to traverse the NAT.

    Finally you will need 2 server-side logic items: 1) Signaling server 2) TURN or proxy server

    To start, take a look Web Call Server. The server implements HTML5 Websocket signaling and SRTP proxying as a TURN server. You can also learn the webrtc application open source code.

    First steps: 1. Download the signaling and streaming server. 2. Download and unzip web client. 3. Start the web client and debug javascript code to learn more how webrtc works.

提交回复
热议问题