提交 4b51a47e authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Improve README

上级 c97199a1
...@@ -10,14 +10,12 @@ Powerful [WebRTC](http://www.webrtc.org/) SFU ("Selective Forwarding Unit") serv ...@@ -10,14 +10,12 @@ Powerful [WebRTC](http://www.webrtc.org/) SFU ("Selective Forwarding Unit") serv
## Features ## Features
* Not a boring standalone server, but a Node library exposing a pure JavaScript API. * Not a boring standalone server, but a Node library exposing a pure JavaScript API. This is: `var mediasoup = require('mediasoup');`
* Supports *WebRTC* media requirements ([ICE-Lite](http://tools.ietf.org/html/rfc5245), [DTLS-SRTP](http://tools.ietf.org/html/rfc5764), [rtcp-mux](http://tools.ietf.org/html/rfc5761), [bundle](http://tools.ietf.org/html/draft-ietf-mmusic-sdp-bundle-negotiation)) along with classic VoIP technologies ([SDES-SRTP](http://tools.ietf.org/html/rfc4568), plain [RTP/RTCP](http://tools.ietf.org/html/rfc3550)). * Modern design: Designed with [ORTC](http://ortc.org) in mind, but also valid for WebRTC.
* ICE/DTLS/RTP/RTCP over UDP and TCP. * "Selective Forwarding Unit" architecture as defined in [draft-ietf-avtcore-rtp-topologies-update](https://tools.ietf.org/html/draft-ietf-avtcore-rtp-topologies-update).
* Multi participant real-time sessions. * ICE/DTLS/RTP/RTCP/DataChannel over UDP and TCP, IPv4 and IPv6.
* IPv6 ready. * Signaling agnostic: **mediasoup** does not deal with SIP or other signaling protocols. In the other hand, it can deal with *any* signaling protocol.
* Signaling agnostic. **mediasoup** does not deal with SIP or other signaling protocols. In the other side, it can deal with *any* signaling protocol. * Extremely powerful: Media handler subprocess (*mediasoup-worker*) is coded in C++ on top of the awesome [libuv](https://github.com/libuv/libuv) asychronous I/O library. **mediasoup** takes full advantage of your CPU capabilities by launching as many workers as needed.
* SDP unaware. Really, **mediasoup** will not parse a SDP for you.
* Extremely powerful. Media handler subprocess (*mediasoup-worker*) is coded in C++ on top of the awesome [libuv](https://github.com/libuv/libuv) asychronous I/O library. **mediasoup** takes full advantage of your CPU capabilities by launching as many workers as needed.
## Usage ## Usage
...@@ -25,8 +23,8 @@ Powerful [WebRTC](http://www.webrtc.org/) SFU ("Selective Forwarding Unit") serv ...@@ -25,8 +23,8 @@ Powerful [WebRTC](http://www.webrtc.org/) SFU ("Selective Forwarding Unit") serv
```javascript ```javascript
var mediasoup = require('mediasoup'); var mediasoup = require('mediasoup');
// Create a server with 4 worker subprocesses. // Create a mediasoup server.
var server = mediasoup.Server({ numWorkers: 4 }); var server = mediasoup.Server();
// Create a conference room. // Create a conference room.
var room = server.Room(); var room = server.Room();
...@@ -62,7 +60,10 @@ signalingServer.on('invite', (request) => ...@@ -62,7 +60,10 @@ signalingServer.on('invite', (request) =>
}); });
// Set remote DTLS parameters. // Set remote DTLS parameters.
transport.setRemoteDtlsParameters( // `transport.setRemoteDtlsParameters()` returns a Promise that resolves
// with `transport` itself so it can be handled in the next `then()`
// handler.
return transport.setRemoteDtlsParameters(
{ {
role : request.dtlsRole, role : request.dtlsRole,
fingerprint : fingerprint :
...@@ -70,8 +71,9 @@ signalingServer.on('invite', (request) => ...@@ -70,8 +71,9 @@ signalingServer.on('invite', (request) =>
algorithm : request.remoteFingerprint.type, algorithm : request.remoteFingerprint.type,
value : request.remoteFingerprint.hash value : request.remoteFingerprint.hash
} }
});
}) })
.then(() => .then((transport) =>
{ {
// Set our DTLS parameters into the response. // Set our DTLS parameters into the response.
response.dtlsRole = transport.dtlsLocalParameters.role; response.dtlsRole = transport.dtlsLocalParameters.role;
...@@ -84,7 +86,6 @@ signalingServer.on('invite', (request) => ...@@ -84,7 +86,6 @@ signalingServer.on('invite', (request) =>
// And send the response. // And send the response.
signalingServer.send(response); signalingServer.send(response);
}); });
});
}); });
``` ```
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论