10 | * Just production ready applications are listed.
11 | * We, mediasoup authors, are aware of many other companies and products using mediasoup. However they prefer not to disclosure it so we cannot list them below.
12 |
62 |
63 |
64 |
65 |
66 | ### Events
67 | {: #Peer-events}
68 |
69 | The `Peer` class inherits from [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter).
70 |
71 |
72 |
73 | #### peer.on("close", fn())
74 | {: #peer-on-close .code}
75 |
76 | Emitted when the remote `peer` is closed or leaves the `room`.
77 |
78 | #### peer.on("newconsumer", fn(consumer))
79 | {: #peer-on-notify .code}
80 |
81 | Emitted when a new `consumer` is created for receiving new media produced by the remote `peer`.
82 |
83 |
81 |
82 | #### mediasoupClient.isDeviceSupported()
83 | {: #mediasoupClient-isDeviceSupported .code}
84 |
85 | Returns a Boolean indicating if the current browser/device is supported by mediasoup-client.
86 |
87 | #### mediasoupClient.getDeviceInfo()
88 | {: #mediasoupClient-getDeviceInfo .code}
89 |
90 | Returns a [DeviceInfo](#mediasoupClient-DeviceInfo) Object with the browser/device information.
91 |
92 | #### mediasoupClient.checkCapabilitiesForRoom(roomRtpCapabilities)
93 | {: #mediasoupClient-checkCapabilitiesForRoom .code}
94 |
95 | Checks the audio/video capabilities of the current device/browser for the remote `room` given its RTP capabilities.
96 |
97 | It returns a Promise that resolves to an Object with `audio` and `video` Booleans, indicating whether sending and receiving audio/video is possible once joined in that `room`.
98 |
99 |
108 | This method is useful in the scenario in which the application wishes to request the user with mic/webcam permissions before joining the room. By running this method before, the application could avoid requesting webcam permission to the user if his browser does not support the video codec of the room.
109 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/_includes/documentation/v2/mediasoup/api/RtpStreamer.md:
--------------------------------------------------------------------------------
1 | ## RtpStreamer
2 | {: #RtpStreamer}
3 |
4 | An `rtpStreamer` represents both a specialized [Consumer](#Consumer) and a [PlainRtpTransport](#PlainRtpTransport). It's created by calling the [`room.createRtpStreamer()`](#room-createRtpStreamer) by passing a [Producer](#Producer) and [RtpStreamOptions](#RtpStreamer-RtpStreamerOptions).
5 |
6 | The RTP and RTCP received by the `producer` will be relayed/mirrored to the given IP and port using plain RTP/RTCP.
7 |
8 |
9 | ### Dictionaries
10 | {: #RtpStreamer-dictionaries}
11 |
12 |
13 |
14 | #### RtpStreamerOptions
15 | {: #RtpStreamer-RtpStreamerOptions .code}
16 |
17 |
18 |
19 | Field | Type | Description | Required | Default
20 | ------------ | ------- | ------------- | -------- | ---------
21 | `remoteIP` | String | Destination IP. | Yes |
22 | `remotePort` | Number | Destination port. | Yes |
23 | `localIP` | String | Local IP. | No | `rtcIPv4` or `rtcIPv6` given in [ServerSettings](#Server-ServerSettings)
24 |
25 |
26 |
27 |
28 | If `localIP` is given, the RTP port range given in [ServerSettings](#Server-ServerSettings) (`rtcMinPort` - `rtcMaxPort`) is not honored and, instead, any available random port will be used.
29 |
30 |
31 |
32 |
33 |
34 |
35 | ### Properties
36 | {: #RtpStreamer-properties}
37 |
38 |
39 |
40 | #### rtpStreamer.consumer
41 | {: #rtpStreamer-consumer .code}
42 |
43 | * Read only
44 |
45 | The generated [Consumer](#Consumer) instance.
46 |
47 | #### rtpStreamer.transport
48 | {: #rtpStreamer-transport .code}
49 |
50 | * Read only
51 |
52 | The generated [PlainRtpTransport](#PlainRtpTransport) instance.
53 |
54 |
55 |
56 |
57 | ### Methods
58 | {: #RtpStreamer-methods}
59 |
60 |
61 |
62 | #### rtpStreamer.close()
63 | {: #rtpStreamer-close .code}
64 |
65 | Closes the `rtpStreamer`, including its `consumer` and `transport`, and triggers a [`close`](#rtpStreamer-on-close) event.
66 |
67 |
68 |
69 |
70 | ### Events
71 | {: #RtpStreamer-events}
72 |
73 | The `RtpStreamer` class inherits from [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter).
74 |
75 |
76 |
77 | #### rtpStreamer.on("close", fn())
78 | {: #rtpStreamer-on-close .code}
79 |
80 | Emitted when the `rtpStreamer` is closed.
81 |
82 |
83 |
--------------------------------------------------------------------------------
/_includes/documentation/v2/mediasoup/api/errors.md:
--------------------------------------------------------------------------------
1 | ## errors
2 | {: #errors}
3 |
4 | The `errors` module (exported via [`mediasoup.errors`](#mediasoup-errors)) holds custom [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) classes internally used by mediasoup.
5 |
6 |
7 | ### Classes
8 | {: #errors-classes}
9 |
10 |
11 |
12 | #### errors.InvalidStateError
13 | {: #errors-InvalidStateError .code}
14 |
15 | This error happens when an API method is called on an Object in invalid state (for example when such an Object is closed).
16 |
17 |
18 |
--------------------------------------------------------------------------------
/_includes/documentation/v2/mediasoup/api/mediasoup.md:
--------------------------------------------------------------------------------
1 | ## mediasoup
2 | {: #mediasoup}
3 |
4 | The top-level module exported by the mediasoup module.
5 |
6 | ```javascript
7 | const mediasoup = require("mediasoup");
8 | ```
9 |
10 |
11 | ### Properties
12 | {: #mediasoup-properties}
13 |
14 |
15 |
16 | #### mediasoup.errors
17 | {: #mediasoup-errors .code}
18 |
19 | Provides access to the [errors](#errors) module.
20 |
21 |
22 |
23 |
24 | ### Functions
25 | {: #mediasoup-functions}
26 |
27 |
28 |
29 | #### mediasoup.Server(settings)
30 | {: #mediasoup-Server .code}
31 |
32 | Returns a new [Server](#Server) instance.
33 |
34 |
45 | Check the [Communication Between Client and Server](/documentation/v3/communication-between-client-and-server/) section for more details.
46 |
47 |
48 | #### consumer.GetTrack()
49 | {: #Consumer-GetTrack .code}
50 |
51 | The remote audio or video track.
52 |
53 | > `@returns` webrtc::MediaStreamTrackInterface\*
54 |
55 | #### consumer.GetStats()
56 | {: #Consumer-GetStats .code}
57 |
58 | Gets the local RTP receiver statistics by calling `getStats()` in the underlying `RTCRtpReceiver` instance.
59 |
60 | > `@async` blocks current thread
61 | >
62 | > `@returns` nlohmann::json [RTCStatsReport](https://w3c.github.io/webrtc-pc/#dom-rtcstatsreport)
63 |
64 | #### consumer.GetAppData()
65 | {: #Consumer-GetAppData .code}
66 |
67 | Custom data Object provided by the application in the consumer factory method. The app can modify its content at any time.
68 |
69 | > `@returns` const nlohmann::json&
70 |
71 | #### consumer.IsClosed()
72 | {: #Consumer-IsClosed .code}
73 |
74 | Whether the consumer is closed.
75 |
76 | > `@returns` bool
77 |
78 | #### consumer.IsPaused()
79 | {: #Consumer-IsPaused .code}
80 |
81 | Whether the consumer is paused.
82 |
83 | > `@returns` bool
84 |
85 | #### consumer.Close()
86 | {: #Consumer-Close .code}
87 |
88 | Closes the consumer.
89 |
90 |
91 | This method should be called when the server side consumer has been closed (and vice-versa).
92 |
93 |
94 | #### consumer.Pause()
95 | {: #Consumer-Pause .code}
96 |
97 | Pauses the consumer. Internally the library executes `track->set_enabled(false)` in the remote track.
98 |
99 |
100 | This method should be called when the server side consumer has been paused (and vice-versa).
101 |
102 |
103 | #### consumer.Resume()
104 | {: #Consumer-Resume .code}
105 |
106 | Resumes the consumer Internally the library executes `track->set_enabled(true)` in the remote track.
107 |
108 |
109 | This method should be called when the server side consumer has been resumed (and vice-versa).
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/_includes/documentation/v3/libmediasoupclient/api/ConsumerListener.md:
--------------------------------------------------------------------------------
1 | ## Consumer::Listener
2 | {: #ConsumerListener}
3 |
4 |
5 |
6 |
7 | > `@abstract`
8 |
9 | This is an abstract class which must be implemented and used according to the API.
10 |
11 |
12 |
13 |
14 | ### Events
15 | {: #ConsumerListener-events}
16 |
17 |
18 |
19 | #### ConsumerListener::OnTransportClose(consumer)
20 | {: #ConsumerListener-OnTransportClose .code}
21 |
22 | Executed when the transport this consumer belongs to is closed for whatever reason. The consumer itself is also closed.
23 |
24 |
70 |
71 | #### DataConsumerListener::OnTransportClose(consumer)
72 | {: #DataConsumerListener-OnTransportClose .code}
73 |
74 | Executed when the transport this consumer belongs to is closed for whatever reason. The consumer itself is also closed.
75 |
76 |
104 |
105 | ```c++
106 | void MyConsumerListener::OnMessage(DataConsumer* dataConsumer, const webrtc::DataBuffer& buffer)
107 | {
108 | if (dataConsumer->GetLabel() == "chat")
109 | {
110 | std::string message = std::string(buffer.data.data(), buffer.data.size());
111 | std::cout << "received chat message: " << message << std::endl;
112 | }
113 | }
114 | ```
115 |
116 |
117 |
--------------------------------------------------------------------------------
/_includes/documentation/v3/libmediasoupclient/api/DataProducer.md:
--------------------------------------------------------------------------------
1 | ## DataProducer
2 | {: #DataProducer}
3 |
4 |
5 |
6 | A data producer represents a data source that will be transmitted to the mediasoup router through a WebRTC transport.
7 |
8 |
9 |
10 |
11 | ### Methods
12 | {: #DataProducer-methods}
13 |
14 |
15 |
16 | #### dataProducer.GetId()
17 | {: #DataProducer-GetId .code}
18 |
19 | Producer identifier.
20 |
21 | > `@returns` const std::string&
22 |
23 | #### dataProducer.GetSctpStreamParameters()
24 | {: #DataProducer-GetSctpStreamParameters .code}
25 |
26 | The SCTP stream parameters.
27 |
28 | > `@returns` [const SctpStreamParameters](/documentation/v3/mediasoup/sctp-parameters/#SctpStreamParameters).
29 |
30 | #### dataProducer.GetReadyState()
31 | {: #DataProducer-GetReadyState .code}
32 |
33 | The DataChannel ready state.
34 |
35 | > `@type` webrtc::DataChannelInterface::DataState
36 |
37 | #### dataProducer.GetLabel()
38 | {: #DataProducer-GetLabel .code}
39 |
40 | The DataChannel label.
41 |
42 | > `@returns` std::string, read only
43 |
44 | #### dataProducer.GetProtocol()
45 | {: #DataProducer-GetProtocol .code}
46 |
47 | The DataChannel sub-protocol.
48 |
49 | > `@returns` std::string, read only
50 |
51 | #### dataProducer.GetBufferedAmount()
52 | {: #DataProducer-GetBufferedAmount .code}
53 |
54 | The number of bytes of application data (UTF-8 text and binary data) that have been queued using `send()`.
55 |
56 | > `@returns` uint64_t, read only
57 |
58 | #### dataProducer.GetAppData
59 | {: #DataProducer-GetAppData .code}
60 |
61 | Custom data Object provided by the application in the data producer factory method. The app can modify its content at any time.
62 |
63 | > `@returns` const nlohmann::json&
64 |
65 | #### dataProducer.IsClosed()
66 | {: #DataProducer-IsClosed .code}
67 |
68 | Whether the data producer is closed.
69 |
70 | > `@returns` bool
71 |
72 | #### dataProducer.Close()
73 | {: #DataProducer-Close .code}
74 |
75 | Closes the data producer. No more data is transmitted.
76 |
77 |
78 | This method should be called when the server side producer has been closed (and vice-versa).
79 |
80 |
81 | #### dataProducer.Send(buffer)
82 | {: #DataProducer-Send .code}
83 |
84 | Sends the given data over the corresponding DataChannel. If the data can't be sent at the SCTP level (due to congestion control), it's buffered at the data channel level, up to a maximum of 16MB. If Send is called while this buffer is full, the data channel will be closed abruptly.
85 |
86 | So, it's important to use [GetBufferedAmount](#DataProducer-GetBufferedAmount) and [OnBufferedAmountChange](#DataProducerListener-OnBufferAmountChange) to ensure the data channel is used efficiently but without filling this buffer.
87 |
88 |
89 |
90 | Argument | Type | Description | Required | Default
91 | --------------- | ------- | ----------- | -------- | ----------
92 | `buffer` | webrtc::DataBuffer& | Data message to be sent. | No |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/_includes/documentation/v3/libmediasoupclient/api/DataProducerListener.md:
--------------------------------------------------------------------------------
1 | ## DataProducer::Listener
2 | {: #DataProducerListener}
3 |
4 |
5 |
6 |
7 | > `@abstract`
8 |
9 | This is an abstract class which must be implemented and used according to the API.
10 |
11 |
12 |
13 |
14 | ### Events
15 | {: #DataProducerListener-events}
16 |
17 |
18 |
19 | #### DataProducerListener::OnOpen(producer)
20 | {: #DataProducerListener-OnOpen .code}
21 |
22 | Executed when the underlying DataChannel is open.
23 |
24 |
44 |
45 | #### DataProducerListener::OnBufferAmountChange(producer, sentDataSize)
46 | {: #DataProducerListener-OnBufferAmountChange .code}
47 |
48 | Executed when the DataChannel buffered amount of bytes changes.
49 |
50 |
51 |
52 | Argument | Type | Description | Required | Default
53 | --------------- | ------- | ----------- | -------- | ----------
54 | `producer` | [DataProducer\*](#DataProducer) | The producer instance executing this method. | Yes |
55 | `sentDataSize` | uint64_t | The amount of data sent. | Yes |
56 |
57 |
58 |
59 | #### DataProducerListener::OnTransportClose(producer)
60 | {: #DataProducerListener-OnTransportClose .code}
61 |
62 | Executed when the transport this producer belongs to is closed for whatever reason. The producer itself is also closed.
63 |
64 |
31 | * "LOG_DEBUG" only applies if libmediasoupclient [MEDIASOUPCLIENT_LOG_DEV](/documentation/v3/libmediasoupclient/installation/#Building-Flags) building flag is set.
32 | * Log trace only applies if libmediasoupclient [MEDIASOUPCLIENT_LOG_TRACE](/documentation/v3/libmediasoupclient/installation/#Building-Flags) building flag is set and `LogLevel` is "LOG_DEBUG".
33 |
31 |
32 | ```c++
33 | void MyProducerListener::OnTransportClose(mediasoupclient::Producer* producer)
34 | {
35 | std::cout << "transport closed" << std::endl;
36 | }
37 | ```
38 |
39 |
40 |
--------------------------------------------------------------------------------
/_includes/documentation/v3/libmediasoupclient/api/RecvTransport.md:
--------------------------------------------------------------------------------
1 | ## RecvTransport
2 | {: #RecvTransport}
3 |
4 |
5 |
6 | > `@inherits` [Transport](#Transport)
7 |
8 | A WebRTC receive transport connects a mediasoupclient [Device](#Device) with a mediasoup [Router](/documentation/v3/mediasoup/api/#Router) at media level and enables the reception of media (by means of [Consumer](#Consumer) instances).
9 |
10 | Internally, the transport holds a WebRTC [RTCPeerConnection](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection) instance.
11 |
12 |
13 |
14 |
15 | ### Methods
16 | {: #Transport-methods}
17 |
18 |
19 |
20 | #### recvTransport.Consume(listener, id, producerId, kind, rtpParameters, appData)
21 | {: #transport-Consume .code}
22 |
23 | Instructs the transport to receive an audio or video track to the mediasoup router.
24 |
25 |
26 |
27 | Argument | Type | Description | Required | Default
28 | ----------- | ------- | ----------- | -------- | ----------
29 | `listener` | [Consumer::Listener](#ConsumerListener) | Consumer listener. | Yes |
30 | `id` | const std::string& | The identifier of the server side consumer. | Yes |
31 | `producerId` | const std::string& | The identifier of the server side producer being consumed. | Yes |
32 | `kind` | const std::string& | Media kind ("audio" or "video"). | Yes |
33 | `rtpParameters` | const nlohmann::json\* [RtpReceiveParameters](/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#RtpReceiveParameters) | Receive RTP parameters. | Yes |
34 | `appData` | nlohmann::json | Custom application data. | No | `{ }`
35 |
36 |
37 |
38 | > `@async` blocks current thread
39 | >
40 | > `@returns` [Consumer](#Consumer)
41 |
42 | ```c++
43 | auto* consumerListener = new MyConsumerListener();
44 |
45 | // This will block the current thread until completion.
46 | auto* consumer = recvTransport->Consume(
47 | consumerListener,
48 | id,
49 | producerId,
50 | kind,
51 | rtpParameters);
52 | ```
53 |
54 | #### recvTransport.ConsumeData(listener, id, producerId, label, protocol, appData)
55 | {: #transport-ConsumeData .code}
56 |
57 | Instructs the transport to receive data via [DataChannel](https://www.w3.org/TR/webrtc/#rtcdatachannel) from the mediasoup router.
58 |
59 |
60 |
61 | Argument | Type | Description | Required | Default
62 | ----------- | ------- | ----------- | -------- | ----------
63 | `listener` | [DataConsumer::Listener](#DataConsumerListener) | Consumer listener. | Yes |
64 | `id` | const std::string& | The identifier of the server side consumer. | Yes |
65 | `producerId` | const std::string& | The identifier of the server side producer being consumed. | Yes |
66 | `label` | const std::string& | A label which can be used to distinguish this DataChannel from others. | Yes |
67 | `protocol` | const std::string& | Name of the sub-protocol used by this DataChannel. | No |
68 | `appData` | nlohmann::json | Custom application data. | No | `{ }`
69 |
70 |
71 |
72 | > `@async` blocks current thread
73 | >
74 | > `@returns` [DataConsumer](#DataConsumer)
75 |
76 | ```c++
77 | auto* consumerListener = new MyConsumerListener();
78 |
79 | // This will block the current thread until completion.
80 | auto* consumer = recvTransport->Consume(
81 | consumerListener,
82 | id,
83 | "dataChannelLabel",
84 | "dataChannelProtocol");
85 | ```
86 |
87 |
88 |
--------------------------------------------------------------------------------
/_includes/documentation/v3/libmediasoupclient/api/RecvTransportListener.md:
--------------------------------------------------------------------------------
1 | ## RecvTransport::Listener
2 | {: #RecvTransportListener}
3 |
4 |
5 |
6 | > `@inherits` [Transport::Listener](#TransportListener)
7 | >
8 | > `@abstract`
9 |
10 | This is an abstract class which must be implemented and used according to the API.
11 |
12 |
13 |
--------------------------------------------------------------------------------
/_includes/documentation/v3/libmediasoupclient/api/Transport.md:
--------------------------------------------------------------------------------
1 | ## Transport
2 | {: #Transport}
3 |
4 |
5 |
6 | A `Transport` instance in libmediasoupclient represents the local side of a [WebRtcTransport](/documentation/v3/mediasoup/api/#WebRtcTransport) in mediasoup server. A WebRTC transport connects a mediasoupclient [Device](#Device) with a mediasoup [Router](/documentation/v3/mediasoup/api/#Router) at media level and enables the sending of media (by means of [Producer](#Producer) instances) **or** the receiving of media (by means of [Consumer](#Consumer) instances).
7 |
8 | Internally, the transport holds a WebRTC [RTCPeerConnection](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection) instance.
9 |
10 |
11 |
12 |
13 | ### Methods
14 | {: #Transport-methods}
15 |
16 |
17 |
18 | #### transport.GetId()
19 | {: #Transport-GetId .code}
20 |
21 | Transport identifier. It matches the `id` of the server side transport.
22 |
23 | > `@returns` const std::string&
24 |
25 | #### transport.GetConnectionState()
26 | {: #Transport-GetConnectionState .code}
27 |
28 | The current connection state of the local peerconnection.
29 |
30 | > `@returns` const std::string& [RTCPeerConnectionState](https://w3c.github.io/webrtc-pc/#rtcpeerconnectionstate-enum)
31 |
32 | #### transport.GetStats()
33 | {: #Transport-GetStats .code}
34 |
35 | Gets the local transport statistics by calling `getStats()` in the underlying `RTCPeerConnection` instance.
36 |
37 | > `@async` blocks current thread
38 | >
39 | > `@returns` nlohmann::json& [RTCStatsReport](https://w3c.github.io/webrtc-pc/#dom-rtcstatsreport)
40 |
41 | #### transport.GetAppData()
42 | {: #Transport-GetAppData .code}
43 |
44 | Custom data Object provided by the application in the transport constructor. The app can modify its content at any time.
45 |
46 | > `@returns` const nlohmann::json&
47 |
48 | #### transport.IsClosed()
49 | {: #Transport-IsClosed .code}
50 |
51 | Whether the transport is closed.
52 |
53 | > `@returns` bool
54 |
55 | #### transport.Close()
56 | {: #Transport-Close .code}
57 |
58 | Closes the transport, including all its producers and consumers.
59 |
60 |
61 | This method should be called when the server side transport has been closed (and vice-versa).
62 |
63 |
64 | #### transport.RestartIce(iceParameters)
65 | {: #Transport-RestartIce .code}
66 |
67 | Instructs the underlying peerconnection to restart ICE by providing it with new remote ICE parameters.
68 |
69 |
70 |
71 | Argument | Type | Description | Required | Default
72 | --------------- | ------- | ----------- | -------- | ----------
73 | `iceParameters` | const nlohmann::json& [IceParameters](/documentation/v3/mediasoup/api/#WebRtcTransportIceParameters) | New ICE parameters of the server side transport. | Yes |
74 |
75 |
80 | This method must be called after restarting ICE in server side via [webRtcTransport.restartIce()](/documentation/v3/mediasoup/api/#webRtcTransport-restartIce).
81 |
82 |
83 | ```c++
84 | transport.RestartIce(iceParameters);
85 | ```
86 |
87 | #### transport.UpdateIceServers(iceServers)
88 | {: #Transport-UpdateIceServers .code}
89 |
90 | Provides the underlying peerconnection with a new list of TURN servers.
91 |
92 |
93 |
94 | Argument | Type | Description | Required | Default
95 | --------------- | ------- | ----------- | -------- | ----------
96 | `iceServers` | const nlohmann::json& Array<[RTCIceServer](https://w3c.github.io/webrtc-pc/#rtciceserver-dictionary)> | List of TURN servers to provide the local peerconnection with. | No | `[ ]`
97 |
98 |
99 |
100 |
101 | This method is specially useful if the TURN server credentials have changed.
102 |
103 |
104 | ```javascript
105 | transport.updateIceServers(iceServers);
106 | ```
107 |
108 |
109 |
--------------------------------------------------------------------------------
/_includes/documentation/v3/libmediasoupclient/api/TransportListener.md:
--------------------------------------------------------------------------------
1 | ## Transport::Listener
2 | {: #TransportListener}
3 |
4 |
5 |
6 | > `@abstract`
7 |
8 | This is an abstract class inherited by [SendTransport::Listener](#SendTransportListener) and [RecvTransport::Listener](#RecvTransportListener).
9 |
10 |
11 |
12 |
13 | ### Events
14 | {: #TransportListener-events}
15 |
16 |
17 |
18 | #### TransportListener::OnConnect(transport, dtlsParameters)
19 | {: #TransportListener-OnConnect .code}
20 |
21 | Called when the transport is about to establish the ICE+DTLS connection and needs to exchange information with the associated server side transport.
22 |
23 |
80 |
81 | Argument | Type | Description
82 | --------- | ------- | ----------------
83 | `dominantSpeaker` | [ActiveSpeakerObserverDominantSpeaker](#ActiveSpeakerObserverDominantSpeaker) | Speaker with most dominant audio in the last interval.
84 |
85 |
86 |
87 |
88 |
89 |
90 | ### Observer Events
91 | {: #ActiveSpeakerObserver-observer-events}
92 |
93 |
94 |
95 | See also [RTP Observer Observer Events](#RtpObserver-observer-events).
96 |
97 | #### activeSpeakerObserver.observer.on("dominantspeaker", fn(dominantSpeaker))
98 | {: #activeSpeakerObserver-observer-on-producer .code}
99 |
100 | Same as the [producer](#activeSpeakerObserver-on-dominantspeaker) event.
101 |
102 |
103 |
--------------------------------------------------------------------------------
/_includes/documentation/v3/mediasoup/api/AudioLevelObserver.md:
--------------------------------------------------------------------------------
1 | ## AudioLevelObserver
2 | {: #AudioLevelObserver}
3 |
4 |
5 |
6 | > `@inherits` [RtpObserver](#RtpObserver)
7 |
8 | An audio level observer monitors the volume of the selected audio producers. It just handles audio producers (if [addProducer()](#rtpObserver-addProducer) is called with a video producer it will fail).
9 |
10 | Audio levels are read from an RTP header extension. No decoding of audio data is done. See [RFC6464](https://tools.ietf.org/html/rfc6464) for more information.
11 |
12 |
13 |
14 |
15 | ### Dictionaries
16 | {: #AudioLevelObserver-dictionaries}
17 |
18 |
19 |
20 | #### AudioLevelObserverOptions
21 | {: #AudioLevelObserverOptions .code}
22 |
23 |
24 |
25 | Field | Type | Description | Required | Default
26 | -------------- | ------- | ------------ | -------- | ----------
27 | `maxEntries` | Number | Maximum number of entries in the "volumes" event. | No | 1
28 | `threshold` | Number | Minimum average volume (in dBvo from -127 to 0) for entries in the "volumes" event. | No | -80
29 | `interval` | Number | Interval in ms for checking audio volumes. | No | 1000
30 | `appData` | [AppData](#AppData) | Custom application data. | No | `{ }`
31 |
32 |
39 |
40 | Field | Type | Description | Required | Default
41 | -------------- | ------- | ------------ | -------- | ----------
42 | `producer` | [Producer](#Producer) | The audio producer instance. | Yes |
43 | `volume` | Number | The average volume (in dBvo from -127 to 0) of the audio producer in the last interval. | Yes |
44 |
45 |
56 |
57 |
65 |
66 |
67 |
68 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/_plugins/breadcrumbs.rb:
--------------------------------------------------------------------------------
1 | require_relative 'drops/breadcrumb_item.rb'
2 |
3 | Jekyll::Hooks.register [:pages, :documents], :pre_render do |side, payload| # documents are collections, and collections include also posts
4 | drop = Drops::BreadcrumbItem
5 |
6 | if side.url == "/"
7 | then payload["breadcrumbs"] = [
8 | drop.new(side, payload)
9 | ]
10 | else
11 | payload["breadcrumbs"] = []
12 | path = side.url.split("/")
13 |
14 | 0.upto(path.size - 1) do |int|
15 | joined_path = path[0..int].join("/")
16 | sides = [].concat(side.site.pages).concat(side.site.documents)
17 | item = sides.find { |side_| joined_path == "" && side_.url == "/" || side_.url.chomp("/") == joined_path }
18 | payload["breadcrumbs"] << drop.new(item, payload) if item
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/_plugins/drops/breadcrumb_item.rb:
--------------------------------------------------------------------------------
1 | module Drops
2 | class BreadcrumbItem < Liquid::Drop
3 | extend Forwardable
4 |
5 | def_delegator :@page, :data
6 | def_delegator :@page, :url
7 |
8 | def initialize(page, payload)
9 | @payload = payload
10 | @page = page
11 | end
12 |
13 | def title
14 | @page.data["breadcrumb"] != nil ? @page.data["breadcrumb"] : @page.data["title"]
15 | end
16 |
17 | def namespace
18 | @page.data["namespace"]
19 | end
20 |
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/documentation/examples.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Examples
3 | anchors : true
4 | ---
5 |
6 |
7 | # Examples
8 |
9 |
10 | ### versatica/mediasoup-demo
11 |
12 | **Project:** [https://github.com/versatica/mediasoup-demo](https://github.com/versatica/mediasoup-demo)
13 |
14 | This is the "official" mediasoup demo made by mediasoup authors. Said that, we (the authors) don't want this demo to become the "mediasoup reference" and encourage developers to read the API documentation instead.
15 |
16 | The **mediasoup-demo** has a client side web application and a server side Node.js application:
17 |
18 | * The client side is a [React](https://reactjs.org) application that uses [mediasoup-client](https://github.com/versatica/mediasoup-client) and [protoo-client](https://www.npmjs.com/package/protoo-client) among other libraries.
19 | * The server side is a Node.js application that uses [mediasoup](https://github.com/versatica/mediasoup) and [protoo-server](https://www.npmjs.com/package/protoo-server).
20 | * [protoo](https://protoo.versatica.com) is a JavaScript library for both, client and server sides, that provides an easy way for clients to connect via WebSocket to a shared room. The API offers request/response transactions and notifications in both directions.
21 | - As an alternative (there are many) readers may be more used to [socket.io](https://socket.io).
22 |
23 |
24 | ### versatica/mediasoup-broadcaster-demo
25 |
26 | **Project:** [https://github.com/versatica/mediasoup-broadcaster-demo](https://github.com/versatica/mediasoup-broadcaster-demo)
27 |
28 | Made by [mediasoup authors](https://github.com/versatica), this project is a
29 | [libmediasoupclient](https://github.com/versatica/libmediasoupclient/) based application that takes the system microphone and webcam and produces the media to the specified room in [mediasoup-demo](https://github.com/versatica/mediasoup-demo/) application.
30 |
31 |
32 | ### Kurento/mediasoup-demos
33 |
34 | **Project:** [https://github.com/Kurento/mediasoup-demos](https://github.com/Kurento/mediasoup-demos)
35 |
36 | Contains mediasoup + Kurento integration projects.
37 |
38 |
39 | ### vpalmisano/mediasoupbin
40 |
41 | **Project:** [https://github.com/vpalmisano/mediasoupbin](https://github.com/vpalmisano/mediasoupbin)
42 |
43 | GStreamer plugin for mediasoup-demo.
44 |
45 |
46 | ### havfo/multiparty-meeting
47 |
48 | **Project:** [https://github.com/havfo/multiparty-meeting](https://github.com/havfo/multiparty-meeting)
49 |
50 | **Web:** [https://letsmeet.no](https://letsmeet.no)
51 |
52 | Multiparty web-meetings using mediasoup and WebRTC. It started as a fork of mediasoup-demo but has evolved quite a bit.
53 |
54 |
55 | ### ethand91/mediasoup3-record-demo
56 |
57 | **Project:** [https://github.com/ethand91/mediasoup3-record-demo](https://github.com/ethand91/mediasoup3-record-demo)
58 |
59 | Simple audio/video record application using mediasoup and GStreamer or FFmpeg.
60 |
61 |
62 | ### mkhahani/mediasoup-sample-app
63 |
64 | **Project:** [https://github.com/mkhahani/mediasoup-sample-app](https://github.com/mkhahani/mediasoup-sample-app)
65 |
66 | A minimal client/server app based on Mediasoup and Socket.io made by [@mkhahani](https://github.com/mkhahani).
67 |
68 |
69 | ### daily-co/mediasoup-sandbox
70 |
71 | **Project:** [https://github.com/daily-co/mediasoup-sandbox/tree/master/single-page](https://github.com/daily-co/mediasoup-sandbox/tree/master/single-page)
72 |
73 | Sample code with the the simplest possible signaling, and fewest possible dependencies, for cross-browser testing of:
74 |
75 | * Sending/receiving audio and video tracks
76 | * Switching to a different input device and replacing a track
77 | * Screen sharing
78 | * Subscribing to and unsubscribing from tracks
79 | * Pausing tracks for sender and receiver independently
80 | * Simulcast
81 | * Setting maximum simulcast layer when sending
82 | * Setting maximum simulcast layer when receiving
83 | * Display of stats
84 | * Display of "active speaker"
85 |
86 |
87 | ### Dirvann/mediasoup-sfu-webrtc-video-rooms
88 |
89 | **Project:** [https://github.com/Dirvann/mediasoup-sfu-webrtc-video-rooms](https://github.com/Dirvann/mediasoup-sfu-webrtc-video-rooms)
90 |
91 | Example website for multi-party video/audio/screen conferencing using mediasoup. This project is intended to better understand how mediasoup works with a simple example.
92 |
93 |
94 | ### Others
95 |
96 | Other public projects using mediasoup can be found in [GitHub](https://github.com/versatica/mediasoup/network/dependents).
97 |
98 |
--------------------------------------------------------------------------------
/documentation/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Documentation
3 | ---
4 |
5 |
6 | # Documentation
7 |
8 | ##### [Overview](/documentation/overview/)
9 |
10 | A brief introduction to mediasoup and its ecosystem.
11 |
12 | ##### [v3 Documentation](/documentation/v3/)
13 |
14 | mediasoup, mediasoup-rust, mediasoup-client and libmediasoupclient v3.
15 |
16 | ##### [v2 Documentation](/documentation/v2/)
17 |
18 | mediasoup and mediasoup-client v2.
19 |
20 | ##### [v1 Documentation](/documentation/v1/)
21 |
22 | mediasoup v1.
23 |
24 | ##### [Examples](/documentation/examples/)
25 |
26 | mediasoup usage samples.
27 |
28 | ##### [Publications](/documentation/publications/)
29 |
30 | Publications and studies about mediasoup.
31 |
--------------------------------------------------------------------------------
/documentation/overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Overview
3 | anchors : true
4 | ---
5 |
6 |
7 | # Overview
8 |
9 | An [SFU](https://webrtcglossary.com/sfu/) (Selective Forwarding Unit) receives audio and video streams from endpoints and relays them to everyone else (endpoints send one and receive many). Each receiver endpoint can select which streams and spatial/temporal layers it receives. Compared to a mixer or [MCU](https://webrtcglossary.com/mcu/) (Multipoint Conferencing Unit) this design leads to a better performance, higher throughput and less latency. It's highly scalable and requires much less resources given that it does not transcode or mix media.
10 |
11 | Since endpoints get the other endpoints' media separately, they can have a personalized layout and choose which streams to render and how to display them.
12 |
13 |
14 | Detailed information regarding the architecture of an SFU can be found at RFC 7667 "RTP Topologies" [section 3.7](https://tools.ietf.org/html/rfc7667#section-3.7).
15 |
16 |
17 |
18 | ## Design Goals
19 |
20 | mediasoup and its client side libraries are designed to accomplish with the following goals:
21 |
22 | * Be a [SFU](https://webrtcglossary.com/sfu/) (Selective Forwarding Unit).
23 | * Support both WebRTC and plain RTP input and output.
24 | * Be a Node.js module in server side.
25 | * Be a tiny JavaScript and C++ libraries in client side.
26 | * Be minimalist: just handle the media layer.
27 | * Be signaling agnostic: do not mandate any signaling protocol.
28 | * Be super low level API.
29 | * Support all existing WebRTC endpoints.
30 | * Enable integration with well known multimedia libraries/tools.
31 |
32 |
33 | ## Use Cases
34 |
35 | mediasoup and its client side libraries provide a super low level API. They are intended to enable different use cases and scenarios, without any constraint or assumption. Some of these use cases are:
36 |
37 | * Group video chat applications.
38 | * One-to-many (or few-to-many) broadcasting applications in real-time.
39 | * RTP streaming.
40 |
--------------------------------------------------------------------------------
/documentation/publications.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Publications
3 | anchors : true
4 | ---
5 |
6 |
7 | # Publications
8 |
9 |
10 | ### Comparative Study of WebRTC Open Source SFUs for Video Conferencing
11 |
12 | "Comparative Study of WebRTC Open Source SFUs for Video Conferencing", by Emmanuel André, Nicolas Le Breton, Augustin Lemesle, Ludovic Roux and Alexandre Gouaillard ([CoSMo Software](https://www.cosmosoftware.io)), in "Proceedings of Principles, Systems and Applications of IP Telecommunications".
13 |
14 | * Illinois Institute of Technology, Chicago, USA
15 | * October 2018
16 | * [Download PDF](/resources/CoSMo_ComparativeStudyOfWebrtcOpenSourceSfusForVideoConferencing.pdf)
17 |
18 | This study used mediasoup v2.
19 |
20 |
21 | ### Performance Testing with mediasoup: 1:many video broadcasting
22 |
23 | Topic in the [mediasoup Discourse Group](https://mediasoup.discourse.group/) about performance of mediasoup v3 for 1:many video broadcasting using various mediasoup `workers` and `pipeToRouter()`. It includes performance testing numbers:
24 |
25 | * [Link to the topic](https://mediasoup.discourse.group/t/experience-with-mediasoup/1578)
26 |
--------------------------------------------------------------------------------
/documentation/v1/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : v1
3 | ---
4 |
5 |
6 | # v1 Documentation
7 |
8 |
9 | mediasoup v1 is no longer documented. Sorry. Anyway it's no longer maintained so please move to the latest version.
10 |
11 |
--------------------------------------------------------------------------------
/documentation/v2/glossary.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Glossary
3 | anchors : true
4 | ---
5 |
6 |
7 | # Glossary
8 |
9 | Both mediasoup and mediasoup-client refer to the same common entities that are represented in both client and server sides. Those entities are described below:
10 |
11 |
12 | ### Room
13 | {: #Glossary-Room}
14 |
15 | A **Room** represents a multi-party conference with N participants (**Peers**). Within a **Room**, audio and video tracks generated by a client/browser are relayed to all the participants.
16 |
17 |
18 | ### Peer
19 | {: #Glossary-Peer}
20 |
21 | A **Peer** represents a participant in the conference, thus it has a local (client side) representation and a remote (server side) representation. When a client joins a **Room** it also gets information about existing and new **Peers** in the conference.
22 |
23 | A **Peer** holds a set of associated **Transport**, **Producer** and **Consumer** instances.
24 |
25 |
26 | ### Transport
27 | {: #Glossary-Transport}
28 |
29 | A **Transport** represents a path for sending or receiving audio/video RTP and RTCP. In the context of WebRTC this means a network path negotiated by both, the client and the server, via ICE and DTLS. A **Transport** has an associated entity in both client and server sides.
30 |
31 |
32 | ### Producer
33 | {: #Glossary-Producer}
34 |
35 | A **Producer** represents and handles a media track (audio or video) sent by a client to the server. A **Producer** has an associated entity in both client and server sides, meaning that both sides (the client app and the server app) can run API methods on it (such as pausing or resuming it).
36 |
37 | In order to send the media track to the server, the **Producer** needs to be provided with a **Transport** instance.
38 |
39 | In mediasoup (server side) a **Producer** is connected with many **Consumers** associated to it.
40 |
41 |
42 | ### Consumer
43 | {: #Glossary-Consumer}
44 |
45 | A **Consumer** represents and handles a media track (audio or video) sent by the server to the client. A **Consumer** has an associated entity in both client and server sides, meaning that both sides (the client app and the server app) can run API methods on it (such as pausing or resuming it).
46 |
47 | Typically, a **Consumer** has a remote **Producer** as a source. In fact, an audio **Producer** created by Alice's **Peer** will trigger the creation of an audio **Consumer** in Bob's **Peer** and all the other **Peers**.
48 |
49 | It's up to the client side application whether to enable/activate a **Consumer** (by providing a **Transport**) or not. Once enabled, the corresponding RTP is relayed to the client.
50 |
51 |
52 | ### Profile
53 | {: #Glossary-Profile}
54 |
55 | A **Profile** represents a RTP quality layer and, hence, just makes sense for [simulcast](https://tools.ietf.org/html/draft-westerlund-avtcore-rtp-simulcast) streams.
56 |
57 | mediasoup defines the following profiles:
58 |
59 | * **default**: If no simulcast, it just points to the single audio or video RTP stream. When there is simulcast, this profile means the highest available stream.
60 | * **low**: The lowest profile. In simulcast this means the stream with lowest video resolution.
61 | * **medium**: The medium profile. In simulcast this means the stream with medium video resolution.
62 | * **high**: The highest profile. In simulcast this means the stream with highest video resolution.
63 | * **none**: Special case when there is no available stream (this may happen at **Consumer** level when no profile can be sent to the remote client).
64 |
--------------------------------------------------------------------------------
/documentation/v2/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : v2
3 | ---
4 |
5 |
6 | # v2 Documentation
7 |
8 | ### General
9 |
10 | * [Glossary](/documentation/v2/glossary/)
11 | * [mediasoup protocol](/documentation/v2/mediasoup-protocol/)
12 | * [RTC stats](/documentation/v2/rtc-stats/)
13 |
14 | ### mediasoup
15 |
16 | {% include documentation/v2/mediasoup/index.md %}
17 |
18 | ### mediasoup-client
19 |
20 | {% include documentation/v2/mediasoup-client/index.md %}
21 |
--------------------------------------------------------------------------------
/documentation/v2/mediasoup-client/api.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : API
3 | anchors : true
4 | apiToc : true
5 | class : h3color
6 | ---
7 |
8 |
9 |
10 | * Will be replaced with the ToC
11 | {: toc}
12 |
13 |
14 |
15 |
16 |
17 |
18 | # mediasoup-client v2 API
19 |
20 | {% include documentation/v2/mediasoup-client/api/mediasoupClient.md %}
21 |
22 | {% include documentation/v2/mediasoup-client/api/Room.md %}
23 |
24 | {% include documentation/v2/mediasoup-client/api/Transport.md %}
25 |
26 | {% include documentation/v2/mediasoup-client/api/Producer.md %}
27 |
28 | {% include documentation/v2/mediasoup-client/api/Peer.md %}
29 |
30 | {% include documentation/v2/mediasoup-client/api/Consumer.md %}
31 |
--------------------------------------------------------------------------------
/documentation/v2/mediasoup-client/debugging.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Debugging
3 | anchors : true
4 | ---
5 |
6 |
7 | # Debugging
8 |
9 |
10 | ## Log Levels
11 |
12 | mediasoup-client uses the [debug](https://www.npmjs.com/package/debug) module to log to the browser console.
13 |
14 | There are three log severities:
15 |
16 | * **debug**: verbose information logged to `console.info`
17 | * **warn**: warning messages logged to `console.warn`
18 | * **error**: error messages logged to `console.error`
19 |
20 | All the logs generated by mediasoup-client have a namespace starting with "mediasoup-client" plus colon, followed by the log severity in upper case plus colon (just if "warn" or "error"), and followed by the internal component name (if any) and the log message.
21 |
22 |
23 | ## Enable Logging
24 |
25 | By default logging is turned off. In order to enable it, the `debug` key in the browser's `localStorage` must be set.
26 |
27 |
28 | Check the [debug](https://www.npmjs.com/package/debug) module documentation for further information regarding how to filter specific log messages based on namespace matching rules.
29 |
30 |
31 |
32 | ### Example
33 |
34 | Within the `` section of your HTML app:
35 |
36 | ```html
37 |
40 |
41 |
42 | ```
43 |
--------------------------------------------------------------------------------
/documentation/v2/mediasoup-client/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : mediasoup-client
3 | ---
4 |
5 |
6 | # Documentation
7 |
8 | Client side JavaScript library.
9 |
10 | * [Installation](/documentation/v2/mediasoup-client/installation/)
11 | * [API](/documentation/v2/mediasoup-client/api/)
12 | * [Debugging](/documentation/v2/mediasoup-client/debugging/)
13 |
--------------------------------------------------------------------------------
/documentation/v2/mediasoup-client/installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Installation
3 | anchors : true
4 | ---
5 |
6 |
7 | # Installation
8 |
9 | Install mediasoup-client within you client application:
10 |
11 | ```bash
12 | $ npm install mediasoup-client@2
13 | ```
14 |
15 |
16 | ## Usage
17 |
18 | Depending on how your web application loads libraries (for example, by using a JavaScript module loader) your may need to use one of the following ways to load mediasoup-client:
19 |
20 | * Using `import`:
21 |
22 | ```javascript
23 | import * as mediasoupClient from "mediasoup-client";
24 | ```
25 |
26 | * Using CommonJS with [browserify](http://browserify.org) or [webpack](https://webpack.github.io):
27 |
28 | ```javascript
29 | const mediasoupClient = require("mediasoup-client");
30 | ```
31 |
--------------------------------------------------------------------------------
/documentation/v2/mediasoup-protocol.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : mediasoup protocol
3 | ---
4 |
5 |
6 | # mediasoup protocol
7 |
8 | Although mediasoup does not implement a signaling protocol, both the client (mediasoup-client) and the server (mediasoup) must exchange messages. Those messages can be **request**/**response** pairs or **notifications**, and can be sent in both directions.
9 |
10 | Those messages can be serialized to JSON bodies for network transmission, but may be converted into JavaScripts Objects (`JSON.parse()`) before they are given to the corresponding API methods in both mediasoup and mediasoup-client.
11 |
12 | The exact definition of the message payloads that must be exchanged is documented in the [MEDIASOUP_PROTOCOL.md](https://github.com/versatica/mediasoup-client/blob/v2/MEDIASOUP_PROTOCOL.md) file included in the mediasoup-client source code.
13 |
14 |
15 | The application developer does not need to know in depth about these messages, but can intercept them for advanced usages.
16 |
17 |
18 |
19 | ## Request/response pairs and notifications
20 |
21 | mediasoup-client can generate both **requests** and **notifications** to be sent to mediasoup, while mediasoup just generates **notifications** and **responses** for mediasoup-client.
22 |
23 | * A mediasoup protocol **request** is an Object that requires a **response** from the other side.
24 | * A mediasoup protocol **notification** is also an Object that includes a `notification: true` key/value and does **NOT** require a **response**.
25 |
26 |
27 | It's up to the application how to correlate those **requests** and their associated **responses**, for example by enveloping the **request** and its **response** into a signaling transaction that uses a `id` field to match them.
28 |
29 |
30 |
31 | ## Message target
32 |
33 | Both **requests** and **notifications** sent by mediasoup-client have a `target` key whose value can be "room" or "peer":
34 |
35 | * `target: "room"` means that the **request** or **notification** must be delivered to the corresponding server side [Room](/documentation/v2/mediasoup/api/#Room).
36 | * The `Room` just accepts **requests** by calling to its [room.receiveRequest()](/documentation/v2/mediasoup/api/#room-receiveRequest) method.
37 | * `target: "peer"` means that the **request** or **notification** must be delivered to the corresponding server side [Peer](/documentation/v2/mediasoup/api/#Peer).
38 | * The `Peer` accepts **requests** by calling to its [peer.receiveRequest()](/documentation/v2/mediasoup/api/#peer-receiveRequest) method.
39 | * The `Peer` accepts **notifications** by calling to its [peer.receiveNotification()](/documentation/v2/mediasoup/api/#peer-receiveNotification) method.
40 |
41 |
42 | It's up to the application how to correlate those **requests** and their associated **responses**, for example by enveloping the **request** and its **response** into a signaling transaction that uses a `id` field to match them.
43 |
10 | * Will be replaced with the ToC
11 | {: toc}
12 |
13 |
14 |
15 |
16 |
17 |
18 | # mediasoup v2 API
19 |
20 | {% include documentation/v2/mediasoup/api/mediasoup.md %}
21 |
22 | {% include documentation/v2/mediasoup/api/Server.md %}
23 |
24 | {% include documentation/v2/mediasoup/api/Room.md %}
25 |
26 | {% include documentation/v2/mediasoup/api/Peer.md %}
27 |
28 | {% include documentation/v2/mediasoup/api/Transport.md %}
29 |
30 | {% include documentation/v2/mediasoup/api/WebRtcTransport.md %}
31 |
32 | {% include documentation/v2/mediasoup/api/PlainRtpTransport.md %}
33 |
34 | {% include documentation/v2/mediasoup/api/Producer.md %}
35 |
36 | {% include documentation/v2/mediasoup/api/Consumer.md %}
37 |
38 | {% include documentation/v2/mediasoup/api/ActiveSpeakerDetector.md %}
39 |
40 | {% include documentation/v2/mediasoup/api/RtpStreamer.md %}
41 |
42 | {% include documentation/v2/mediasoup/api/errors.md %}
43 |
--------------------------------------------------------------------------------
/documentation/v2/mediasoup/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : mediasoup
3 | ---
4 |
5 |
6 | # Documentation
7 |
8 | C++ SFU and server side Node.js module.
9 |
10 | * [Installation](/documentation/v2/mediasoup/installation/)
11 | * [API](/documentation/v2/mediasoup/api/)
12 | * [Debugging](/documentation/v2/mediasoup/debugging/)
13 |
--------------------------------------------------------------------------------
/documentation/v2/mediasoup/installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Installation
3 | anchors : true
4 | ---
5 |
6 |
7 | # Installation
8 |
9 | Install the mediasoup Node.js module via NPM within your Node.js application:
10 |
11 | ```bash
12 | $ npm install mediasoup@2
13 | ```
14 |
15 |
16 | ## Requirements
17 |
18 | In order to build the C/C++ component the following packages and libraries must be available in the target host:
19 |
20 | * Node.js >= `v6.4.0`
21 | * POSIX based operating system (Windows not supported)
22 | * Python 2 (`python2` or `python` command must point to the Python 2 executable)
23 | * `make`
24 | * `gcc` and `g++` or `clang` (with C++11 support)
25 | * `cc` command pointing to `gcc` or `clang`
26 |
27 |
28 | * In Debian and Ubuntu install the `build-essential` DEB package. It includes both `make` and `gcc`/`g++`.
29 | * In YUM based Linux (Red Hat, CentOS) use `yum groupinstall "Development Tools"`.
30 | * The installation path MUST NOT contain whitespaces.
31 |
32 |
--------------------------------------------------------------------------------
/documentation/v2/rtc-stats.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : RTC stats
3 | anchors : true
4 | ---
5 |
6 |
7 | # RTC stats
8 |
9 | Similar to [WebRTC](https://w3c.github.io/webrtc-stats/) and [ORTC](https://draft.ortc.org/#rtcstats-dictionary), mediasoup provides stats in server side. If enabled, they are also delivered to mediasoup-client.
10 |
11 | Currently stats are generated for the following entities:
12 |
13 | * [WebRtcTransport](/documentation/v2/mediasoup/api/#WebRtcTransport)
14 | * [Producer](/documentation/v2/mediasoup/api/#Producer)
15 | * [Consumer](/documentation/v2/mediasoup/api/#Consumer)
16 |
17 | Stats are an Array of Objects.
18 |
19 |
20 | ## Examples
21 |
22 | ### Video consumer stats
23 |
24 | When enabling stats for a `consumer`, received stats look as follows:
25 |
26 | ```js
27 | [
28 | {
29 | bitrate: 126032
30 | byteCount: 3813723
31 | firCount: 0
32 | fractionLost: 0
33 | id: '8nvfesjqo5ntjm3k'
34 | jitter: 17
35 | kind: 'video'
36 | mediaType: 'video'
37 | mimeType: 'video/VP8'
38 | nackCount: 16
39 | packetCount: 4566
40 | packetsDiscarded: 0
41 | packetsLost: 10
42 | packetsRepaired: 8
43 | pliCount: 29
44 | sliCount: 0
45 | ssrc: 3514166852
46 | timestamp: 139426926
47 | type: 'inbound-rtp'
48 | },
49 | {
50 | bitrate: 126032
51 | byteCount: 6025653
52 | firCount: 0
53 | fractionLost: 0
54 | id: 'x2dtpsmtsmnp7dwp'
55 | inboundRtpId: '8nvfesjqo5ntjm3k'
56 | kind: 'video'
57 | mediaType: 'video'
58 | mimeType: 'video/VP8'
59 | nackCount: 17
60 | packetCount: 6431
61 | packetsDiscarded: 0
62 | packetsLost: 38
63 | packetsRepaired: 14
64 | pliCount: 0
65 | roundTripTime: 25
66 | sliCount: 0
67 | ssrc: 93410199
68 | timestamp: 139426926
69 | transportId: 20102291
70 | type: 'outbound-rtp'
71 | }
72 | ]
73 | ```
74 |
75 | Here there is an Array with two Objects, one for the stream being consumed by the `consumer` (with `type: 'outbound-rtp'`) and another with the stats of the associated `producer` (`type: 'inbound-rtp'`). Note that the second one includes a `inboundRtpId: '8nvfesjqo5ntjm3k'` field referencing the associated `producer`'s stats Object within the array.
76 |
77 |
78 | When the `producer` uses simulcast (so it sends N streams with different SSRC values) the stats Object with `type: 'inbound-rtp'` references the stats of the specific inbound stream with same profile ("low", "medium" or "high") that the `consumer` is receiving in that moment.
79 |
80 |
81 |
--------------------------------------------------------------------------------
/documentation/v3/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : v3
3 | ---
4 |
5 |
6 | # v3 Documentation
7 |
8 | ### General
9 |
10 | * [Communication Between Client and Server](/documentation/v3/communication-between-client-and-server/)
11 | * [Scalability](/documentation/v3/scalability/)
12 | * [Tricks](/documentation/v3/tricks/)
13 |
14 | ### mediasoup
15 |
16 | {% include documentation/v3/mediasoup/index.md %}
17 |
18 | ### mediasoup-rust
19 |
20 | Brings the same powerful C++ SFU to the Rust ecosystem, shares design philosophy with Node.js module.
21 |
22 | * [Documentation on docs.rs](https://docs.rs/mediasoup)
23 | * [Crate on crates.io](https://crates.io/crates/mediasoup)
24 |
25 | ### mediasoup-client
26 |
27 | {% include documentation/v3/mediasoup-client/index.md %}
28 |
29 | ### libmediasoupclient
30 |
31 | {% include documentation/v3/libmediasoupclient/index.md %}
32 |
33 | ### mediasoup-client-aiortc
34 |
35 | mediasoup-client handler for [aiortc](https://github.com/aiortc/aiortc/) Python library. Suitable for building Node.js applications that connect to a mediasoup server using WebRTC and exchange real audio, video and DataChannel messages with it in both directions.
36 |
37 | Documentation is exposed in the project [README](https://github.com/versatica/mediasoup-client-aiortc/blob/v3/README.md) file.
38 |
--------------------------------------------------------------------------------
/documentation/v3/libmediasoupclient/api.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : API
3 | anchors : true
4 | apiToc : true
5 | class : h3color
6 | ---
7 |
8 |
9 |
10 | * Will be replaced with the ToC
11 | {: toc}
12 |
13 |
14 |
15 |
16 |
17 |
18 | # libmediasoupclient v3 API
19 |
20 | {% include documentation/v3/libmediasoupclient/api/mediasoupclient.md %}
21 |
22 | {% include documentation/v3/libmediasoupclient/api/Device.md %}
23 |
24 | {% include documentation/v3/libmediasoupclient/api/Transport.md %}
25 |
26 | {% include documentation/v3/libmediasoupclient/api/TransportListener.md %}
27 |
28 | {% include documentation/v3/libmediasoupclient/api/SendTransport.md %}
29 |
30 | {% include documentation/v3/libmediasoupclient/api/SendTransportListener.md %}
31 |
32 | {% include documentation/v3/libmediasoupclient/api/RecvTransport.md %}
33 |
34 | {% include documentation/v3/libmediasoupclient/api/RecvTransportListener.md %}
35 |
36 | {% include documentation/v3/libmediasoupclient/api/Producer.md %}
37 |
38 | {% include documentation/v3/libmediasoupclient/api/ProducerListener.md %}
39 |
40 | {% include documentation/v3/libmediasoupclient/api/Consumer.md %}
41 |
42 | {% include documentation/v3/libmediasoupclient/api/ConsumerListener.md %}
43 |
44 | {% include documentation/v3/libmediasoupclient/api/DataProducer.md %}
45 |
46 | {% include documentation/v3/libmediasoupclient/api/DataProducerListener.md %}
47 |
48 | {% include documentation/v3/libmediasoupclient/api/DataConsumer.md %}
49 |
50 | {% include documentation/v3/libmediasoupclient/api/DataConsumerListener.md %}
51 |
52 | {% include documentation/v3/libmediasoupclient/api/Logger.md %}
53 |
54 | {% include documentation/v3/libmediasoupclient/api/LoggerLogHandlerInterface.md %}
55 |
56 | {% include documentation/v3/libmediasoupclient/api/nlohmann-json.md %}
57 |
--------------------------------------------------------------------------------
/documentation/v3/libmediasoupclient/debugging.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Debugging
3 | anchors : true
4 | ---
5 |
6 |
7 | # libmediasoupclient v3 Debugging
8 |
9 |
10 | Take a look to the [Logger](/documentation/v3/libmediasoupclient/api/#Logger) API.
11 |
12 |
--------------------------------------------------------------------------------
/documentation/v3/libmediasoupclient/design.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Design
3 | anchors : true
4 | ---
5 |
6 |
7 | # libmediasoupclient v3 Design
8 |
9 | libmediasoupclient is a C++ library based on [libwebrtc](https://webrtc.org/) for building mediasoup based C++ client side applications.
10 |
11 |
12 | ## Features
13 |
14 | * C++11 low level API.
15 | * Uses [libwebrtc](https://webrtc.org/) as native WebRTC engine.
16 |
17 |
18 | ## libwebrtc API
19 |
20 | The application is responsible of using the API exposed by libwebrtc to create instances of `webrtc::MediaStreamTrackInterface` (audio and video tracks) and use them to feed the API methods of libmediasoupclient.
21 |
22 |
23 | This is: libmediasoupclient does not expose any "track factory" API. The application must use libwebrtc for that.
24 |
25 |
26 |
27 | ## Multi Threading
28 |
29 | libmediasoup client does not implement multi-threading. All API methods marked as `@async` block the current thread until the underlaying operation is terminated. Such underlaying operation can be an operation executed by the libwebrtc stack or an operation executed by the user.
30 |
31 | Examples:
32 |
33 | * [device.GetRtpCapabilities()](/documentation/v3/libmediasoupclient/api/#device-GetRtpCapabilities) blocks the current thread until capabilities are internally retrieved and returns them.
34 | * [sendTransport.Produce()](/documentation/v3/libmediasoupclient/api/#SendTransport-Produce) internally performs SDP offer/answer in the underlaying `RTCPeerConnection` instance and blocks the thread until done.
35 | * The [SendTransport::Listener::OnProduce](/documentation/v3/libmediasoupclient/api/#SendTransportListener-OnProduce) event returns a `std::future` and waits for the application to fulfil it (once it communicates to the server).
36 |
--------------------------------------------------------------------------------
/documentation/v3/libmediasoupclient/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : libmediasoupclient
3 | ---
4 |
5 |
6 | # libmediasoupclient v3 Documentation
7 |
8 | {% include documentation/v3/libmediasoupclient/index.md %}
9 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup-client/api.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : API
3 | anchors : true
4 | apiToc : true
5 | class : h3color
6 | ---
7 |
8 |
9 |
10 | * Will be replaced with the ToC
11 | {: toc}
12 |
13 |
14 |
15 |
16 |
17 |
18 | # mediasoup-client v3 API
19 |
20 | {% include documentation/v3/mediasoup-client/api/mediasoupClient.md %}
21 |
22 | {% include documentation/v3/mediasoup-client/api/Device.md %}
23 |
24 | {% include documentation/v3/mediasoup-client/api/Transport.md %}
25 |
26 | {% include documentation/v3/mediasoup-client/api/Producer.md %}
27 |
28 | {% include documentation/v3/mediasoup-client/api/Consumer.md %}
29 |
30 | {% include documentation/v3/mediasoup-client/api/DataProducer.md %}
31 |
32 | {% include documentation/v3/mediasoup-client/api/DataConsumer.md %}
33 |
34 | {% include documentation/v3/mediasoup-client/api/observer-api.md %}
35 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup-client/debugging.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Debugging
3 | anchors : true
4 | ---
5 |
6 |
7 | # mediasoup-client v3 Debugging
8 |
9 | * Will be replaced with the ToC
10 | {: toc}
11 |
12 |
13 | ## Log Levels
14 | {: #Log-Level}
15 |
16 | mediasoup-client uses the [debug](https://www.npmjs.com/package/debug) module to log to the browser console.
17 |
18 | There are three log severities:
19 |
20 | * **debug**: verbose information logged to `console.info`
21 | * **warn**: warning messages logged to `console.warn`
22 | * **error**: error messages logged to `console.error`
23 |
24 | All the logs generated by mediasoup-client have a namespace starting with "mediasoup-client" plus colon, followed by the log severity in upper case plus colon (just if "warn" or "error"), and followed by the internal component name (if any) and the log message.
25 |
26 |
27 | ## Enable Logging
28 | {: #Enable-Logging}
29 |
30 | By default logging is turned off. In order to enable it, the `debug` key in the browser's `localStorage` must be set.
31 |
32 |
33 | Check the [debug](https://www.npmjs.com/package/debug) module documentation for further information regarding how to filter specific log messages based on namespace matching rules.
34 |
35 |
36 |
37 | ### Example
38 | {: #Enable-Logging-Example}
39 |
40 | Within the `` section of your HTML app:
41 |
42 | ```html
43 |
46 |
47 |
48 | ```
49 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup-client/design.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Design
3 | anchors : true
4 | ---
5 |
6 |
7 | # mediasoup-client v3 Design
8 |
9 | mediasoup-client is a JavaScript library for building mediasoup based client side applications (such as web applications). It's a tiny library exposing a powerful cross-browser API and supports all current WebRTC browsers via different [handlers](https://github.com/versatica/mediasoup-client/tree/v3/src/handlers) for each model/version.
10 |
11 |
12 | ## Features
13 |
14 | * ECMAScript low level API.
15 | * Works in the browser and Node.js.
16 |
17 |
18 | There is no native WebRTC or RTP engine in Node.js. When running in Node.js the application must provide mediasoup-client with a custom [handler](/documentation/v3/mediasoup-client/api/#DeviceOptions) to control a 3rd party media/RTP library.
19 |
20 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup-client/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : mediasoup-client
3 | ---
4 |
5 |
6 | # mediasoup-client v3 Documentation
7 |
8 | {% include documentation/v3/mediasoup-client/index.md %}
9 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup-client/installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Installation
3 | anchors : true
4 | ---
5 |
6 |
7 | # mediasoup-client v3 Installation
8 |
9 | Install mediasoup-client within you client application:
10 |
11 | ```bash
12 | $ npm install mediasoup-client@3
13 | ```
14 |
15 |
16 | ## Usage
17 |
18 | mediasoup-client is written in TypeScript and transpiled to JavaScript plus CommonJS. This is: it uses `require()` internally.
19 |
20 | This makes it work in the browser by properly using [browserify](http://browserify.org), [webpack](https://webpack.js.org) or similar tools, and also in Node.js (which does not yet implement `import`/`export`) . It's up to the application developer to decide how to integrate mediasoup-client into his client side application.
21 |
22 |
23 | mediasoup-client does not provide any bundled, minified and/or ES5 transpiled single file. There are tools out there to do that if your application needs it.
24 |
25 |
26 | Depending on how your web application loads libraries (for example, by using a JavaScript module loader) your may need to use one of the following ways to load mediasoup-client:
27 |
28 | * Using `import`:
29 |
30 | ```javascript
31 | import * as mediasoupClient from "mediasoup-client";
32 | ```
33 |
34 | * Using CommonJS with [browserify](http://browserify.org) or [webpack](https://webpack.github.io):
35 |
36 | ```javascript
37 | const mediasoupClient = require("mediasoup-client");
38 | ```
39 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup-client/react-native.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : React Native
3 | anchors : true
4 | ---
5 |
6 |
7 | # React Native
8 |
9 | In order to use mediasoup-client in React Native (for building Android and iOS apps):
10 |
11 | - Include [react-native-webrtc](https://www.npmjs.com/package/react-native-webrtc) dependency into your React Native project.
12 | - Call mediasoup-client exposed [registerGlobals()](https://github.com/react-native-webrtc/react-native-webrtc#registerglobals) function **before** creating a mediasoup-client [Device](/documentation/v3/mediasoup-client/api/#Device-constructor) instance.
13 |
14 |
15 | * By calling `registerGlobals()`, classes such as `RTCPeerConnection` and `MediaStream` (among others) will be exposed in the global scope.
16 | * Those classes are required for the `ReactNative` handler (or the new `ReactNativeUnifiedPlan` handler) of mediasoup-client to work.
17 |
10 | * Will be replaced with the ToC
11 | {: toc}
12 |
13 |
14 |
15 |
16 |
17 |
18 | # mediasoup v3 API
19 |
20 | {% include documentation/v3/mediasoup/api/mediasoup.md %}
21 |
22 | {% include documentation/v3/mediasoup/api/Worker.md %}
23 |
24 | {% include documentation/v3/mediasoup/api/Router.md %}
25 |
26 | {% include documentation/v3/mediasoup/api/WebRtcServer.md %}
27 |
28 | {% include documentation/v3/mediasoup/api/Transport.md %}
29 |
30 | {% include documentation/v3/mediasoup/api/WebRtcTransport.md %}
31 |
32 | {% include documentation/v3/mediasoup/api/PlainTransport.md %}
33 |
34 | {% include documentation/v3/mediasoup/api/PipeTransport.md %}
35 |
36 | {% include documentation/v3/mediasoup/api/DirectTransport.md %}
37 |
38 | {% include documentation/v3/mediasoup/api/Producer.md %}
39 |
40 | {% include documentation/v3/mediasoup/api/Consumer.md %}
41 |
42 | {% include documentation/v3/mediasoup/api/DataProducer.md %}
43 |
44 | {% include documentation/v3/mediasoup/api/DataConsumer.md %}
45 |
46 | {% include documentation/v3/mediasoup/api/RtpObserver.md %}
47 |
48 | {% include documentation/v3/mediasoup/api/ActiveSpeakerObserver.md %}
49 |
50 | {% include documentation/v3/mediasoup/api/AudioLevelObserver.md %}
51 |
52 | {% include documentation/v3/mediasoup/api/observer-api.md %}
53 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup/design.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Design
3 | anchors : true
4 | ---
5 |
6 |
7 | # mediasoup v3 Design
8 |
9 | Unlike other existing SFU implementations, mediasoup is not a standalone server but an unopinionated [Node.js](https://nodejs.org) module which can be integrated into a larger application:
10 |
11 | ```javascript
12 | const mediasoup = require("mediasoup");
13 | ```
14 |
15 | Thus internally, mediasoup can be splitted into two separate components:
16 |
17 | * a JavaScript layer exposing a modern ECMAScript API for Node.js, and
18 | * a set of C/C++ subprocesses that handle the media layer (ICE, DTLS, RTP and so on).
19 |
20 | Both components communicate to each other by means of inter-process communication. However, from the point of view of the developer, the application should just care about the JavaScript API integration.
21 |
22 |
23 | ## Features
24 |
25 | * ECMAScript low level API.
26 | * Multi-stream: multiple audio/video streams over a single ICE + DTLS transport.
27 | * IPv6 ready.
28 | * ICE / DTLS / RTP / RTCP over UDP and TCP.
29 | * Simulcast and SVC support.
30 | * Congestion control.
31 | * Sender and receiver bandwidth estimation with spatial/temporal layers distribution algorithm.
32 | * Extremely powerful (media worker subprocess coded in C++ on top of [libuv](https://libuv.org)).
33 |
34 |
35 | ## Architecture
36 |
37 | {: .full-width }
38 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup/garbage-collection.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Garbage Collection
3 | anchors : true
4 | ---
5 |
6 |
7 | # Garbage Collection
8 |
9 | Due to its design, the Node.js application is responsible of creating and managing mediasoup objects such as workers, routers, transports, producers and consumers. In summary this means that the application must keep references to those objects, call methods on them, listen for events on them and remove those references when the corresponding object has been closed.
10 |
11 |
12 | ## Closure Actions and Events
13 | {: #closure-actions-and-events}
14 |
15 | The mediasoup [API](/documentation/v3/mediasoup/api/) describes all those actions and events. Here just a summary of them.
16 |
17 | A [Worker](/documentation/v3/mediasoup/api/#Worker) is closed when:
18 |
19 | * `worker.close()` is called, or
20 | * `worker.on("died")` event is fired (emitted when the worker process unexpectedly).
21 |
22 | A [Router](/documentation/v3/mediasoup/api/#Router) is closed when:
23 |
24 | * `router.close()` is called, or
25 | * `router.on("workerclose")` event is fired (emitted when the worker this router belongs to is closed for whatever reason).
26 |
27 | A [Transport](/documentation/v3/mediasoup/api/#Transport) is closed when:
28 |
29 | * `transport.close()` is called, or
30 | * `transport.on("routerclose")` event is fired (emitted when the router this transport belongs to is closed for whatever reason).
31 |
32 | A [Producer](/documentation/v3/mediasoup/api/#Producer) is closed when:
33 |
34 | * `producer.close()` is called, or
35 | * `producer.on("transportclose")` event is fired (emitted when the transport this producer belongs to is closed for whatever reason).
36 |
37 | A [Consumer](/documentation/v3/mediasoup/api/#Consumer) is closed when:
38 |
39 | * `consumer.close()` is called, or
40 | * `consumer.on("transportclose")` event is fired (emitted when the transport this consumer belongs to is closed for whatever reason), or
41 | * `consumer.on("producerclose")` event is fired (emitted when the associated producer is closed for whatever reason).
42 |
43 | A [DataProducer](/documentation/v3/mediasoup/api/#DataProducer) is closed when:
44 |
45 | * `dataProducer.close()` is called, or
46 | * `dataProducer.on("transportclose")` event is fired (emitted when the transport this data producer belongs to is closed for whatever reason).
47 |
48 | A [DataConsumer](/documentation/v3/mediasoup/api/#DataConsumer) is closed when:
49 |
50 | * `dataConsumer.close()` is called, or
51 | * `dataConsumer.on("transportclose")` event is fired (emitted when the transport this data consumer belongs to is closed for whatever reason), or
52 | * `consumer.on("dataproducerclose")` event is fired (emitted when the associated data producer is closed for whatever reason).
53 |
54 | A [RtpObserver](/documentation/v3/mediasoup/api/#RtpObserver) is closed when:
55 |
56 | * `rtpObserver.close()` is called, or
57 | * `rtpObserver.on("routerclose")` event is fired (emitted when the router this RTP observer belongs to is closed for whatever reason).
58 |
59 | When any of these `close()` methods is called or "xxxxxclose" event is emitted, the corresponding mediasoup object becomes "closed" (its `closed` property is `true` from now on) and the application should clean the reference to that object.
60 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : mediasoup
3 | ---
4 |
5 |
6 | # mediasoup v3 Documentation
7 |
8 | {% include documentation/v3/mediasoup/index.md %}
9 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup/installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Installation
3 | anchors : true
4 | ---
5 |
6 |
7 | # mediasoup v3 Installation
8 |
9 | Install mediasoup via NPM within your Node.js application:
10 |
11 | ```bash
12 | $ npm install mediasoup@3
13 | ```
14 |
15 | During the installation process, the mediasoup NPM package will try to fetch a prebuilt mediasoup-worker binary appropriate for current platform and architecture. If not found, it will locally build the mediasoup-worker binary.
16 |
17 |
18 | * If "MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD" or "MEDIASOUP_LOCAL_DEV" environment variables are set, or if mediasoup package is being installed via `git+ssh` (instead of via `npm`), and if "MEDIASOUP_FORCE_WORKER_PREBUILT_DOWNLOAD" environment variable is not set, the installation process won't attempt to fetch any prebuilt mediasoup-worker binary and it will build it locally instead.
19 |
20 | ```bash
21 | MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD="true" npm install mediasoup@3
22 | ```
23 |
24 | * If "MEDIASOUP_WORKER_BIN" environment variable is set during mediasoup package installation, mediasoup will use the the value of such an environment variable as mediasoup-worker binary and **won't** compile it locally. And if same environment variable is set when running your Node.js app, mediasoup will use it as mediasoup-worker binary (instead of looking for it in the `mediasoup/worker/out/Release` path).
25 |
26 | ```bash
27 | MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" npm install mediasoup@3
28 | MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" node myapp.js
29 | ```
30 |
31 |
32 |
33 | ## Requirements
34 |
35 | In order to build the mediasoup C/C++ components the following packages and libraries must be available in the target host:
36 |
37 | ### All Platforms
38 |
39 | * Node.js version >= v20.0.0
40 | * Python version >= 3.7 with PIP
41 |
42 |
43 | Python is only required if no prebuilt mediasoup-worker binary was fetched.
44 |
45 |
46 |
47 | ### Linux, OSX and *NIX Systems
48 |
49 | * `gcc` and `g++` >= 8 or `clang` (with C++17 support)
50 | * `cc` and `c++` commands (symlinks) pointing to the corresponding `gcc`/`g++` or `clang`/`clang++` executables
51 |
52 |
53 | * On Debian and Ubuntu install the `python3-pip` DEB package, otherwise PIP package manager might be unavailable.
54 | * On Debian and Ubuntu install the `build-essential` DEB package. It includes `gcc`/`g++`.
55 | * On YUM based Linux (Red Hat, CentOS) use `yum groupinstall "Development Tools"`.
56 | * On musl based systems (such as Alpine Linux) `linux-headers` package must be installed, otherwise abseil-cpp C++ subproject fails to build due to "linux/futex.h: No such file or directory".
57 |
58 |
59 |
60 | If there is neither `python3` nor `python` command pointing to Python 3 executable, set the `PYTHON` environment variable during mediasoup installation:
61 |
62 | ```bash
63 | $ PYTHON=python3.9 npm install mediasoup@3
64 | ```
65 |
66 |
67 |
68 | If the `MEDIASOUP_MAX_CORES` environment variable is set, the build process will use that number of CPU cores. Otherwise, it will auto-detect the number of cores in the machine.
69 |
70 |
71 |
72 | ### Windows
73 |
74 | * Microsoft Visual Studio environment with MSVC compiler (with C++17 support).
75 |
76 |
77 | * Make sure to have **ISRG Root X1** certificate installed, or you will get errors while downloading OpenSSL (whose website is secured with Let's Encrypt), you can import it from (install to Local computer).
78 | * If you have Python-related errors, search for "App execution aliases" in system settings and disable everything Python-related from there.
79 |
38 |
39 | Field | Type | Description | Required | Default
40 | ------ | ------ | ------------- | --------- |
41 | `OS` | Number | Initially requested number of outgoing SCTP streams (from 1 to 65535). | No | 1024
42 | `MIS` | Number | Maximum number of incoming SCTP streams (from 1 to 65535). | No | 1024
43 |
44 |
45 |
46 |
47 | Both `OS` and `MIS` are part of the SCTP INIT+ACK handshake. `OS` refers to the initial number of outgoing SCTP streams that the server side transport creates (to be used by [DataConsumers](#DataConsumer)), while `MIS` refers to the maximum number of incoming SCTP streams that the server side transport can receive (to be used by [DataProducers](#DataProducer)). So, if the server side transport will just be used to create data producers (but no data consumers), `OS` can be low (~1). However, if data consumers are desired on the server side transport, `OS` must have a proper value and such a proper value depends on whether the remote endpoint supports `SCTP_ADD_STREAMS` extension or not.
48 |
49 | * libwebrtc (Chrome, Safari, etc) does not enable `SCTP_ADD_STREAMS` so, if data consumers are required, `OS` should be 1024 (the maximum number of DataChannels that libwebrtc enables).
50 | * Firefox does enable `SCTP_ADD_STREAMS` so, if data consumers are required, `OS` can be lower (16 for instance). The mediasoup transport will allocate and announce more outgoing SCTP streams when needed.
51 | * mediasoup-client provides specific per browser/version `OS` and `MIS` values via the [device.sctpCapabilities](/documentation/v3/mediasoup-client/api/#device-sctpCapabilities) getter.
52 |
53 |
54 | #### SctpStreamParameters
55 | {: #SctpStreamParameters .code}
56 |
57 | SCTP stream parameters describe the reliability of a certain SCTP stream.
58 |
59 |
60 |
61 | Field | Type | Description | Required | Default
62 | ------------------ | ------- | ------------- | -------- | ---------
63 | `streamId` | Number | SCTP stream id | true |
64 | `ordered` | Boolean | Whether data messages must be received in order. if true the messages will be sent reliably. | No | true
65 | `maxPacketLifeTime`| Number | When `ordered` is false indicates the time (in milliseconds) after which a SCTP packet will stop being retransmitted. | No |
66 | `maxRetransmits`| Number | When `ordered` is false indicates the maximum number of times a packet will be retransmitted. | No |
67 |
68 |
69 |
70 |
71 | * If `ordered` is true then `maxPacketLifeTime` and `maxRetransmits` must be false.
72 |
73 | * If `ordered` if false, only one of `maxPacketLifeTime` or `maxRetransmits` can be true.
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/documentation/v3/mediasoup/srtp-parameters.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : SRTP Parameters
3 | anchors : true
4 | ---
5 |
6 |
7 | # SRTP Parameters
8 |
9 | Actually these SRTP parameters just apply to `PlainTransport` and `PipeTransport` which has optional SRTP support.
10 |
11 | ----
12 |
13 | * Will be replaced with the ToC
14 | {: toc}
15 |
16 |
17 | ## Dictionaries
18 | {: #Dictionaries}
19 |
20 |
21 |
22 | #### SrtpParameters
23 | {: #SrtpParameters .code}
24 |
25 |
26 |
27 | Field | Type | Description | Required | Default
28 | --------------| ------ | ------------- | --------- |
29 | `cryptoSuite` | [SrtpCryptoSuite](#SrtpCryptoSuite) | Encryption and authentication transforms to be used. | Yes |
30 | `keyBase64` | String | SRTP keying material (master key and salt) in Base64. | Yes |
31 |
32 |
46 |
47 | Value | Description
48 | ------------------------- | -------------
49 | "AEAD_AES_256_GCM" | It requires SRTP keying material of 44 bytes (60 bytes in Base64).
50 | "AEAD_AES_128_GCM" | It requires SRTP keying material of 28 bytes (40 bytes in Base64).
51 | "AES_CM_128_HMAC_SHA1_80" | It requires SRTP keying material of 30 bytes (40 bytes in Base64).
52 | "AES_CM_128_HMAC_SHA1_32" | It requires SRTP keying material of 30 bytes (40 bytes in Base64).
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/documentation/v3/tricks.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Tricks
3 | anchors : true
4 | ---
5 |
6 |
7 | # mediasoup v3 Tricks
8 |
9 | Some useful tricks for mediasoup and client libraries.
10 |
11 |
12 | ## Using a different video codec in each Producer
13 | {: #using-a-different-video-codec-in-each-producer}
14 |
15 | Sometimes it's useful to use, for instance, H264 for webcam and VP8 for screen sharing. Starting from mediasoup-client 3.6.0, this is possible by using the new `codec` option in [ProducerOptions](/documentation/v3/mediasoup-client/api/#ProducerOptions). Example:
16 |
17 | ```javascript
18 | // Assuming that the mediasoup Router has been provided with both VP8 and H264
19 | // video codecs, let's use H264 for webcam and VP8 for screen sharing.
20 |
21 | const webcamProducer = await sendTransport.produce(
22 | {
23 | track: videoTrack,
24 | codec : device.rtpCapabilities.codecs
25 | .find((codec) => codec.mimeType.toLowerCase() === 'video/h264')
26 | });
27 |
28 | const sharingProducer = await sendTransport.produce(
29 | {
30 | track: sharingTrack,
31 | codec : device.rtpCapabilities.codecs
32 | .find((codec) => codec.mimeType.toLowerCase() === 'video/vp8')
33 | });
34 | ```
35 |
36 | ## RTP capabilities filtering
37 | {: #rtp-capabilities-filtering}
38 |
39 | **Related issue:**
40 |
41 | * Wrong received video orientation in Firefox and FFmpeg.
42 |
43 | The mediasoup [router.rtpCapabilities](/documentation/v3/mediasoup/api/#router-rtpCapabilities) represent the RTP capabilities that the router supports. While the `codecs` list depends on the [RouterOptions](/documentation/v3/mediasoup/api/#RouterOptions) given by during the router creation, other RTP capabilities such as the `headerExtensions` are fixed and are basically a copy of the `headerExtensions` in the [supportedRtpCapabilities.ts](https://github.com/versatica/mediasoup/blob/v3/node/src/supportedRtpCapabilities.ts) file of mediasoup.
44 |
45 | For instance, some of those RTP header extensions can affect the behaviour of the client. A good example is the "urn:3gpp:video-orientation" extension which, if supported by both the client and mediasoup, will make the client to not rotate its sending video (for instance when moving the mobile from portrait to landscape) but, instead, set an orientation value into a RTP header extension. This is supported by Chrome and any libwebrtc based endpoint (such as libmediasoupclient).
46 |
47 | The problem with this is that, if a receiving consumer (i.e. Firefox as per today or FFmpeg) does not support such a RTP header extension, when the sender rotates its video the receiver will not realize of it and will render the received video with an orientation of 90º or -90º. In order to avoid that problem here the trick:
48 |
49 | Being in sender side (let's assume it supports the "urn:3gpp:video-orientation" extension), the application may call [device.load()](/documentation/v3/mediasoup-client/api/#device-load) (mediasoup-client, i.e. Chrome) or [device.load()](/documentation/v3/libmediasoupclient/api/#device-Load) (libmediasoupclient) with a filtered version of the router RTP capabilities by removing the problematic headers. For instance, when in Chrome running mediasoup-client it would be as follows:
50 |
51 | ```javascript
52 | // Let's get router RTP capabilities via our own app signaling.
53 | let routerRtpCapabilities = await mySignaling.request("getRouterRtpCapabilities");
54 |
55 | // Just for Chrome, Safari or any libwebrtc based browser.
56 | if (supportsVideoOrientationHeaderExtension)
57 | {
58 | // Remove the "urn:3gpp:video-orientation" extension so when rotating the
59 | // device, Chrome will encode rotated video instead of indicating the video
60 | // orientation in an RTP header extension.
61 | routerRtpCapabilities.headerExtensions = routerRtpCapabilities.headerExtensions.
62 | filter((ext) => ext.uri !== 'urn:3gpp:video-orientation');
63 | }
64 |
65 | // Finally apply the router RTP capabilities to the device.
66 | await device.load({ routerRtpCapabilities });
67 | ```
68 |
--------------------------------------------------------------------------------
/faq.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : F.A.Q.
3 | anchors : true
4 | ---
5 |
6 |
7 | # F.A.Q.
8 |
9 | * Will be replaced with the ToC
10 | {: toc}
11 |
12 |
13 | ### Why a Node.js module?
14 | {: #why-a-nodejs-module}
15 |
16 | You may wonder "why not a standalone server?". That's a fair question.
17 |
18 | Being a [Node.js](https://nodejs.org) module, mediasoup is easily integrable within larger Node.js applications. Consider that mediasoup just handles the media plane (audio/video streams) so the application needs some kind of signaling mechanism. Having both the signaling and the media handlers working together makes the application architecture easier.
19 |
20 | All those using others languages/platforms for the signaling plane would need to develop their own communication channel with a standalone Node.js server running mediasoup (or wait for somebody to do it).
21 |
22 |
23 | ### Is mediasoup a native addon?
24 | {: #is-mediasoup-a-native-addon}
25 |
26 | Not exactly. [Native addons](https://nodejs.org/api/addons.html) are Node.js extensions written in C/C++ that can be loaded using `require()` as if they were ordinary Node.js modules.
27 |
28 | Instead, mediasoup launches a set of C++ child processes (media workers) and communicates with them by means of inter-process communication. This approach leads to a media worker design not tiled to the internals of Node.js or V8 (which change in every new release).
29 |
30 |
31 | ### Which signaling protocol does it use?
32 | {: #which-signaling-protocol-does-it-use}
33 |
34 | That's a wrong question. mediasoup does not provide any network signaling protocol to communicate with endpoints/browsers. It just handles the media layer and provides a JavaScript API to set the media parameters.
35 |
36 | It's up to the application developer to build his preferred signaling protocol to carry messages with such parameters.
37 |
38 |
39 | ### Is there any example code?
40 | {: #is-there-any-example-code}
41 |
42 | Yes, check the [examples](/documentation/examples/).
43 |
44 |
45 | ### Does mediasoup transcode?
46 | {: #does-mediasoup-transcode}
47 |
48 | No. All the peers in a room should support a common subset of audio and video codecs. Said that, WebRTC defines a list of MTI ("mandatory to implement") audio/video codecs, so in a world of happy unicorns this topic should not be a problem.
49 |
50 |
51 | ### Does it work with legacy SIP endpoints?
52 | {: #does-it-work-with-legacy-sip-endpoints}
53 |
54 | No. If you expected a different response here it means that you have not properly read the mediasoup documentation.
55 |
56 | mediasoup is "just" a SFU, it does not implement the SIP protocol nor it does audio mixing. In order to integrate a SIP/PSTN system with mediasoup you need to build a client or gateway that connects to mediasoup as a regular peer and acts as an audio mixer in the other leg (in which it implements the SIP protocol).
57 |
58 |
59 | ### Running mediasoup in hosts with private IP (AWS, Google Cloud, Azure)
60 | {: #running-mediasoup-in-hosts-with-private-ip}
61 |
62 | Those environments run virtual hosts with private IP and provide mechanisms to route an external public IP into that private IP. mediasoup implements ICE-Lite meaning that it won't initiate ICE connections but will always act as ICE "server" role.
63 |
64 | In order to run mediasoup in those environments (host with private IP and a mapped public IP):
65 |
66 | * Let `HOST_PUBLIC_IP` be the external public IP mapped to your host.
67 | * Redirect the port range given to the transport (`portRange` field) from `HOST_PUBLIC_IP` to your host.
68 | * Of course, also redirect whichever port your application uses for signaling (HTTP/WebSocket) from `HOST_PUBLIC_IP` to your host.
69 | * Use `ip: '0.0.0.0'` and `announcedAddress: HOST_PUBLIC_IP` when creating a transport.
70 |
71 | ### How to use H264 for webcam and VP8 for screen sharing
72 | {: #how-to-use-h264-for-webcam-and-vp8-for-screen-sharing}
73 |
74 | Check the [Tricks](/documentation/v3/tricks/#using-a-different-video-codec-in-each-producer) section.
75 |
76 | ### When consuming a video in Firefox it does not properly rotate
77 | {: #when-consuming-a-video-in-firefox-it-does-not-properly-rotate}
78 |
79 | Check the [Tricks](/documentation/v3/tricks/#rtp-capabilities-filtering) section.
80 |
--------------------------------------------------------------------------------
/favicons-dark-theme/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/android-chrome-192x192.png
--------------------------------------------------------------------------------
/favicons-dark-theme/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/android-chrome-512x512.png
--------------------------------------------------------------------------------
/favicons-dark-theme/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/apple-touch-icon.png
--------------------------------------------------------------------------------
/favicons-dark-theme/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #cccccc
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/favicons-dark-theme/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/favicon-16x16.png
--------------------------------------------------------------------------------
/favicons-dark-theme/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/favicon-32x32.png
--------------------------------------------------------------------------------
/favicons-dark-theme/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/favicon.ico
--------------------------------------------------------------------------------
/favicons-dark-theme/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/mstile-150x150.png
--------------------------------------------------------------------------------
/favicons-dark-theme/safari-pinned-tab.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
24 |
--------------------------------------------------------------------------------
/favicons-dark-theme/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mediasoup",
3 | "short_name": "mediasoup",
4 | "icons": [
5 | {
6 | "src": "/favicons-dark-theme/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "/favicons-dark-theme/android-chrome-512x512.png",
12 | "sizes": "512x512",
13 | "type": "image/png"
14 | }
15 | ],
16 | "theme_color": "#ffffff",
17 | "background_color": "#ffffff",
18 | "display": "standalone"
19 | }
20 |
--------------------------------------------------------------------------------
/favicons-light-theme/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/android-chrome-192x192.png
--------------------------------------------------------------------------------
/favicons-light-theme/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/android-chrome-512x512.png
--------------------------------------------------------------------------------
/favicons-light-theme/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/apple-touch-icon.png
--------------------------------------------------------------------------------
/favicons-light-theme/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #11142c
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/favicons-light-theme/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/favicon-16x16.png
--------------------------------------------------------------------------------
/favicons-light-theme/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/favicon-32x32.png
--------------------------------------------------------------------------------
/favicons-light-theme/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/favicon.ico
--------------------------------------------------------------------------------
/favicons-light-theme/mstile-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-144x144.png
--------------------------------------------------------------------------------
/favicons-light-theme/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-150x150.png
--------------------------------------------------------------------------------
/favicons-light-theme/mstile-310x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-310x150.png
--------------------------------------------------------------------------------
/favicons-light-theme/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-310x310.png
--------------------------------------------------------------------------------
/favicons-light-theme/mstile-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-70x70.png
--------------------------------------------------------------------------------
/favicons-light-theme/safari-pinned-tab.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
31 |
--------------------------------------------------------------------------------
/favicons-light-theme/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "",
3 | "short_name": "",
4 | "icons": [
5 | {
6 | "src": "/favicons-light-theme/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "/favicons-light-theme/android-chrome-512x512.png",
12 | "sizes": "512x512",
13 | "type": "image/png"
14 | }
15 | ],
16 | "theme_color": "#11142c",
17 | "background_color": "#11142c",
18 | "display": "standalone"
19 | }
20 |
--------------------------------------------------------------------------------
/fonts/Monaco.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Monaco.ttf
--------------------------------------------------------------------------------
/fonts/PoiretOne.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/PoiretOne.ttf
--------------------------------------------------------------------------------
/fonts/PoiretOne.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/PoiretOne.woff
--------------------------------------------------------------------------------
/fonts/Roboto-Black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Black.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-BlackItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-BlackItalic.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Bold.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-BoldItalic.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Italic.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Light.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-LightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-LightItalic.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Medium.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-MediumItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-MediumItalic.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Regular.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-Thin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Thin.ttf
--------------------------------------------------------------------------------
/fonts/Roboto-ThinItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-ThinItalic.ttf
--------------------------------------------------------------------------------
/fonts/embed.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This program is for setting TTF files to Installable Embedding mode.
3 | *
4 | * Note that using this to embed fonts which you are not licensed to embed
5 | * does not make it legal.
6 | *
7 | * This code was written by Tom Murphy 7, and is public domain. Use at your
8 | * own risk...
9 | */
10 |
11 | #include
12 | #include
13 |
14 | void fatal();
15 |
16 | int main (int argc, char**argv) {
17 | FILE * inways;
18 | if (argc != 2)
19 | printf("Usage: %s font.ttf\n\nPublic Domain software by Tom 7. Use at your own risk.\n",argv[0]);
20 | else if (inways = fopen(argv[1],"rb+")) {
21 | int a,x;
22 | char type[5];
23 | type[4]=0;
24 | fseek(inways,12,0);
25 | for (;;) {
26 | for (x=0;x<4;x++) if (EOF == (type[x] = getc(inways))) fatal();
27 | if (!strcmp(type,"OS/2")) {
28 | int length;
29 | unsigned long loc, fstype, sum=0;
30 | loc=ftell(inways); /* location for checksum */
31 | for (x=4;x--;) if (EOF == getc(inways)) fatal();
32 | fstype = fgetc(inways) << 24;
33 | fstype |= fgetc(inways) << 16;
34 | fstype |= fgetc(inways) << 8 ;
35 | fstype |= fgetc(inways) ;
36 | length = fgetc(inways) << 24;
37 | length |= fgetc(inways) << 16;
38 | length |= fgetc(inways) << 8 ;
39 | length |= fgetc(inways) ;
40 | /* printf("fstype: %d length: %d\n",fstype,length);*/
41 | if (fseek(inways,fstype+8,0)) fatal();
42 | fputc(0,inways);
43 | fputc(0,inways);
44 | fseek(inways,fstype,0);
45 | for (x=length;x--;)
46 | sum += fgetc(inways);
47 | fseek(inways,loc,0); /* write checksum */
48 | fputc(sum>>24,inways);
49 | fputc(255&(sum>>16),inways);
50 | fputc(255&(sum>>8), inways);
51 | fputc(255&sum , inways);
52 | fclose(inways);
53 | exit(0);
54 | }
55 | for (x=12;x--;) if (EOF == getc(inways)) fatal();
56 | }
57 |
58 | } else
59 | printf("I wasn't able to open the file %s.\n", argv[1]);
60 | }
61 |
62 | void fatal() { fprintf(stderr,"Malformed TTF file.\n");
63 | exit(-1); }
64 |
--------------------------------------------------------------------------------
/github.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : GitHub
3 | anchors : true
4 | ---
5 |
6 |
7 | # GitHub
8 |
9 | ##### [mediasoup](https://github.com/versatica/mediasoup/)
10 |
11 | C++ SFU and server side Node.js module.
12 |
13 |
14 | ##### [mediasoup-client](https://github.com/versatica/mediasoup-client/)
15 |
16 | Client side JavaScript library.
17 |
18 |
19 | ##### [libmediasoupclient](https://github.com/versatica/libmediasoupclient/)
20 |
21 | C++ library based on libwebrtc.
22 |
23 |
24 | ##### [mediasoup-client-aiortc](https://github.com/versatica/mediasoup-client-aiortc/)
25 |
26 | handler for [aiortc](https://github.com/aiortc/aiortc/) Python library. Suitable for building Node.js applications that connect to a mediasoup server using WebRTC and exchange real audio, video and DataChannel messages with it.
27 |
28 |
29 | ##### [mediasoup-demo](https://github.com/versatica/mediasoup-demo/)
30 |
31 | Source code of the [mediasoup demo](https://demo.mediasoup.org) application.
32 |
33 |
34 | ##### [mediasoup-broadcaster-demo](https://github.com/versatica/mediasoup-broadcaster-demo/)
35 |
36 | libmediasoupclient based C++ application that produces the system microphone and webcam into the mediasoup demo.
37 |
38 |
39 | ##### [mediasoup-website](https://github.com/versatica/mediasoup-website/)
40 |
41 | The mediasoup project website at [https://mediasoup.org](https://mediasoup.org).
42 |
43 |
44 | ## 3rd Party Contributions
45 |
46 | Here some libraries and SDKs contributed by non mediasoup authors.
47 |
48 |
49 | Those are just some of the libraries/SDKs that exist. Not all them are covered here.
50 |
39 | This is a donation. No goods or services are expected in return. Any requests for refunds for those purposes will be rejected.
40 |
41 |
42 |
43 | ## Sponsors
44 |
45 | Check the list of individuals and organizations already contributing to mediasoup in Open Collective:
46 |
47 | * [opencollective.com/mediasoup](https://opencollective.com/mediasoup#section-contributors)
48 |
--------------------------------------------------------------------------------
/support.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Support
3 | anchors : true
4 | ---
5 |
6 |
7 | # Support
8 |
9 | mediasoup is an Open Source project supported on a best effort basis. Before asking any questions, please check the [documentation](/documentation/) and the [F.A.Q.](/faq/) (the response may be there).
10 |
11 |
12 | ### Questions and Doubts
13 |
14 |
21 |
22 | Use the **[mediasoup Discourse Group][mediasoup-discourse-group]** for questions and doubts regarding mediasoup and its ecosystem.
23 |
24 | You can also check for historical discussions in the [mediasoup Google Group][mediasoup-google-group] (previously used as mediasoup support forum).
25 |
26 |
39 |
40 | If you find an issue or bug in the software, or want to propose a new feature or improvement, do not hesitate to report it in the corresponding issue tracker:
41 |
42 | * **[mediasoup issue tracker][mediasoup-github-issues]**
43 | * **[mediasoup-client issue tracker][mediasoup-client-github-issues]**
44 | * **[libmediasoupclient issue tracker][libmediasoupclient-github-issues]**
45 |
46 |
47 |
48 |
49 |
50 | Please do **NOT** open an issue in GitHub for questions or doubts. Use the **[mediasoup Discourse Group][mediasoup-discourse-group]** instead.
51 |
52 |
53 | #### Crashes in mediasoup (get a core dump)
54 |
55 | If you get a crash in mediasoup server, this is, if you get an error log as follows:
56 |
57 | ```
58 | 2020-01-06T16:02:57.965Z mediasoup:ERROR:Worker worker process died unexpectedly [pid:22, code:null, signal:SIGABRT]
59 | ```
60 |
61 | or if the [worker.on("died")](/documentation/v3/mediasoup/api/#worker-on-died) event fires, this is a bug in mediasoup that should not happen.
62 |
63 | If so, please report the issue in [GitHub][mediasoup-github-issues] and also enable core dumps in your host.
64 |
65 | ##### Enabling core dumps in Linux
66 |
67 | If you run mediasoup in Linux, do the following **before** running your mediasoup application again:
68 |
69 | ```bash
70 | $ mkdir /tmp/cores
71 | $ chmod 777 /tmp/cores
72 | $ echo "/tmp/cores/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
73 | $ ulimit -c unlimited
74 | ```
75 |
76 | Then run your mediasoup application. If the crash happens again you should get a core dump in the `/tmp/cores` folder. Open it with `gdb` and attach it into the issue reported in GitHub:
77 |
78 | ```bash
79 | $ gdb PATH_TO_YOUR_NODE_APP/node_modules/mediasoup/worker/out/Release/mediasoup-worker PATH_TO_COREFILE
80 | ```
81 |
82 | Then, within the `gdb` terminal:
83 |
84 | ```bash
85 | gdb> bt full
86 | ```
87 |
88 | ##### Enabling core dumps in OSX
89 |
90 | Crashing processes in OSX automatically got a crash report in `/Users/USER/Library/Logs/DiagnosticReports` folder.
91 |
92 | ##### Forcing a core dump or crash report
93 |
94 | You can check whether your setup works by manually generating one as follows:
95 |
96 | ```bash
97 | $ pidof mediasoup-worker
98 | 46717 46718 46719 46720
99 |
100 | $ kill -s SIGSEGV 46717
101 | ```
102 |
103 | Then check the generated core dump or crash report file in the corresponding folder.
104 |
105 |
106 |
107 |
108 | [mediasoup-discourse-group]:https://mediasoup.discourse.group
109 | [mediasoup-google-group]: https://groups.google.com/forum/#!forum/mediasoup
110 | [mediasoup-github-issues]: https://github.com/versatica/mediasoup/issues
111 | [mediasoup-client-github-issues]: https://github.com/versatica/mediasoup-client/issues
112 | [libmediasoupclient-github-issues]: https://github.com/versatica/libmediasoupclient/issues
113 |
--------------------------------------------------------------------------------