List of messages (requests/responses/notifications) that must be exchanged between client and server side of the mediasoup based application. No signaling protocol is provided but just message payloads. The application is responsible of sending and receiving these messages.
Messages generated by the client-side Room
instance that must be given to the corresponding server-side Room
or Peer
instance (depending on the target
field).
Get info about the server-side Room
.
Request:
{
method: 'queryRoom',
target: 'room'
}
Response:
{
rtpCapabilities: {},
mandatoryCodecPayloadTypes: []
}
Create a server-side Peer
.
Other peers will be notified with a newPeer
notification.
Request:
{
method: 'join',
target: 'room',
peerName: 'myname',
rtpCapabilities: {},
appData: Any
}
Response:
{
peers: []
}
Close the server-side Room
.
Other peers will be notified with a peerClosed
notification.
Notification:
{
method: 'leave',
target: 'peer',
notification: true,
appData: Any
}
Create a server-side Transport
.
Request:
{
method: 'createTransport',
target: 'peer',
id: 1111,
direction: 'send', // 'send'/'recv'.
options: {},
dtlsParameters: {}, // Optional.
appData: Any
}
Response:
{
iceParameters: {},
iceCandidates: [],
dtlsParameters: {}
}
Provide pending local parameters (if needed) to a server-side Transport
.
Notification:
{
method: 'updateTransport',
target: 'peer',
notification: true,
id: 1111,
dtlsParameters: {}
}
Request the server-side Transport
to generate new values for its ICE userFragment
and password
.
Request:
{
method: 'restartTransport',
target: 'peer',
id: 1111
}
Response:
{
iceParameters: {}
}
Close a server-side Transport
.
Notification:
{
method: 'closeTransport',
target: 'peer',
notification: true,
id: 1111,
appData: Any
}
Enable periodic transport stats retrieval.
Notification:
{
method: 'enableTransportStats',
id: 3333,
interval: 1
}
Disable periodic transport stats retrieval.
Notification:
{
method: 'disableTransportStats',
id: 3333,
}
Create a server-side Producer
for sending media over the indicate Transport
.
Other peers will be notified with a newConsumer
notification.
Request:
{
method: 'createProducer',
target: 'peer',
id: 2222,
kind: 'audio',
transportId: 1111,
rtpParameters: {},
paused: false,
appData: Any
}
Response: (empty)
Just for libwebrtc based devices (no replaceTrack()
support).
Indicates that the Producer
has changed its sending RTP parameters (in fact, just the SSRCs).
Notification:
{
method: 'updateProducer',
target: 'peer',
notification: true,
id: 2222,
rtpParameters: {}
}
Pause a server-side Producer
.
Other peers will be notified with a consumerPaused
notification.
Notification:
{
method: 'pauseProducer',
target: 'peer',
notification: true,
id: 2222,
appData: Any
}
Resume a server-side Producer
.
Other peers will be notified with a consumerResumed
notification.
Notification:
{
method: 'resumeProducer',
target: 'peer',
notification: true,
id: 2222,
appData: Any
}
Close a server-side Producer
.
Other peers will be notified with a consumerClosed
notification.
Notification:
{
method: 'closeProducer',
target: 'peer',
notification: true,
id: 2222,
appData: Any
}
Enable periodic producer stats retrieval.
Notification:
{
method: 'enableProducerStats',
id: 3333,
interval: 1
}
Disable periodic producer stats retrieval.
Notification:
{
method: 'disableProducerStats',
id: 3333,
}
Enable the reception of media from a server-side Consumer
.
Request:
{
method: 'enableConsumer',
target: 'peer',
id: 3333,
transportId: 9999,
paused: false,
preferredProfile: 'low'
}
Response:
{
paused: false,
preferredProfile: null,
effectiveProfile: 'default'
}
Pause the reception of media from a server-side Consumer
.
Notification:
{
method: 'pauseConsumer',
target: 'peer',
notification: true,
id: 3333,
appData: Any
}
Resume the reception of media from a server-side Consumer
.
Notification:
{
method: 'resumeConsumer',
target: 'peer',
notification: true,
id: 3333,
appData: Any
}
Set the desired receiving profile.
Notification:
{
method: 'setConsumerPreferredProfile',
notification: true,
id: 3333,
profile: 'high'
}
Enable periodic consumer stats retrieval.
Notification:
{
method: 'enableConsumerStats',
id: 3333,
interval: 1
}
Disable periodic consumer stats retrieval.
Notification:
{
method: 'disableConsumerStats',
id: 3333,
}
Messages generated by the server-side Peer
instance that must be given to the client-side Room
instance.
The server-side Room
or my server-side Peer
has been closed in the server.
Notification:
{
method: 'closed',
target: 'peer',
notification: true,
appData: Any
}
A server-side Transport
has been closed in the server.
Notification:
{
method: 'transportClosed',
target: 'peer',
notification: true,
id: 1111,
appData: Any
}
Transport stats, enabled via enableTransportStats
.
Notification:
{
method: 'transportStats',
target: 'peer',
notification: true,
id: 3333,
stats: []
}
A server-side Producer
has been paused in the server.
Notification:
{
method: 'producerPaused',
target: 'peer',
notification: true,
id: 2222,
appData: Any
}
A server-side Producer
has been resumed in the server.
Notification:
{
method: 'producerResumed',
target: 'peer',
notification: true,
id: 2222,
appData: Any
}
A server-side Producer
has been closed in the server.
Notification:
{
method: 'producerClosed',
target: 'peer',
notification: true,
id: 2222,
appData: Any
}
Producer stats, enabled via enableProducerStats
.
Notification:
{
method: 'producerStats',
target: 'peer',
notification: true,
id: 3333,
stats: []
}
A new Peer
has joined the server-side Room
.
Notification:
{
method: 'newPeer',
target: 'peer',
notification: true,
name: 'alice',
consumers:
[
{
id: 5555,
kind: 'audio',
rtpParameters: {},
paused: false,
appData: Any
}
],
appData: Any
}
A server-side Peer
has been closed (it may have left the room or his server-side Peer
has been closed in the server).
Notification:
{
method: 'peerClosed',
target: 'peer',
notification: true,
name: 'alice',
appData: Any
}
A new server-side Consumer
has been created.
Notification:
{
method: 'newConsumer',
target: 'peer',
notification: true,
id: 3333,
kind: 'video',
peerName: 'alice',
rtpParameters: {},
paused: false,
preferredProfile: 'high',
effectiveProfile: 'medium',
appData: Any
}
A server-side Consumer
has been paused (its originating Peer
may have paused it, or his server-side Producer
may have been paused in the server, or my associated Consumer
may have been paused in the server).
Notification:
{
method: 'consumerPaused',
target: 'peer',
notification: true,
id: 3333,
peerName: 'alice',
appData: Any
}
A server-side Consumer
has been resumed (its originating Peer
may have resumed it, or his server-side Producer
may have been resumed in the server, or my associated Consumer
may have been resumed in the server).
Notification:
{
method: 'consumerResumed',
target: 'peer',
notification: true,
id: 3333,
peerName: 'alice',
appData: Any
}
A server-side Consumer
has set its preferred receiving profile.
Notification:
{
method: 'consumerPreferredProfileSet',
target: 'peer',
notification: true,
id: 3333,
peerName: 'alice',
profile: 'medium'
}
The effective receiving profile in a server-side Consumer
changed.
Notification:
{
method: 'consumerEffectiveProfileChanged',
target: 'peer',
notification: true,
id: 3333,
peerName: 'alice',
profile: 'high'
}
Consumer stats, enabled via enableConsumerStats
.
Notification:
{
method: 'consumerStats',
target: 'peer',
notification: true,
id: 3333,
stats: []
}