This is the Web Socket Signaling API specification.
This document describes the commands, responses, and events of the Dolby.io RTS Signaling Server. This document should aid you during your integration with the Dolby.io Real Time Streaming services.
The structure of each of the messages exchanged with the server follows a certain pattern based on transactions. For that, we make use of a TransactionManager which uses a JSON-based message format to exchange data between both ends. The base message is a JSON object with a type property. There are four message types allowed in this specification: 'cmd', 'response', 'error', and 'event'. Each message type property is used for different purposes and has other attributes depending on the message type.
This document will explain how those objects should be sent and received by the Signaling server, depending on the message type.
Channel for publisher
Messages sent from the publisher to the service.
Accepts the following message:
Type of message used by the broadcaster client to send a command to the signaling server and receive a response. It is used when the sending side expects a response from the other side as a result of this command
It requires a transaction identifier (transID) to match responses with their corresponding commands.
The command name field determines the structure and content of the 'data' field, which varies based on the type of command being sent.
{
"type": "cmd",
"transId": 0,
"name": "publish",
"data": {
"name": "lbxyfxso",
"sdp": "sdp",
"codec": "h264",
"record": true,
"events": [
"viewercount"
]
}
}
{
"type": "cmd",
"transId": 0,
"name": "publish",
"data": {
"name": "lbxyfxso",
"sdp": "sdp",
"codec": "h264",
"record": true,
"events": [
"viewercount"
],
"sourceId": ""
}
}
{
"type": "cmd",
"transId": 0,
"name": "publish",
"data": {
"name": "lbxyfxso",
"sdp": "sdp",
"codec": "h264",
"record": true,
"events": [
"viewercount"
],
"sourceId": "cam2"
}
}
{
"type": "cmd",
"transId": 1,
"name": "describe",
"data": {}
}
{
"type": "cmd",
"transId": 1,
"name": "record"
}
{
"type": "cmd",
"transId": 2,
"name": "unrecord"
}
Channel for publisher
Messages the publisher receives from the service.
Accepts one of the following messages:
Type of message sent by the signaling server as a response to a command sent by the broadcaster client. It is used to confirm the acceptance of the command and provide additional data associated with the response.
The content of the 'payload' field in the response message can vary depending on the type of command message that was sent by the broadcaster.
{
"type": "response",
"transId": 0,
"data": {
"uuid": "feeds://77a944b6e75f40929bb6e3274389ae4a/308f7b5a-8429-4da4-b572-52aa3af5fcb2",
"feedId": "308f7b5a-8429-4da4-b572-52aa3af5fcb2",
"publisherId": "77a944b6e75f40929bb6e3274389ae4a",
"clusterId": "do-sfo-legacy",
"streamId": "udAcdT/lbxyfxso",
"sdp": "sdp"
}
}
It is used to reject a command sent by the other peer and pass some custom data associated to the error.
{
"type": "error",
"transId": 3,
"data": "Internal Server Error"
}
Event messages are used when the sending side does not expect any kind of response back. Events can occur at any time.
{
"type": "event",
"name": "viewercount",
"data": {
"viewerCount": 0
}
}
{
"type": "event",
"name": "active",
"data": {
"streamId": "udAcdT/lbxyfxso",
"sourceId": "null",
"tracks": [
{
"trackId": "audio",
"media": "audio"
},
{
"trackId": "video",
"media": "video"
}
]
}
}
{
"type": "event",
"name": "inactive",
"data": {
"streamId": "udAcdT/lbxyfxso",
"sourceId": "null"
}
}
{
"type": "event",
"name": "layers",
"data": {
"medias": {
"0": {
"active": [
{
"id": "1",
"simulcastIdx": 1,
"bitrate": 306776,
"layers": []
},
{
"id": "0",
"simulcastIdx": 0,
"bitrate": 105784,
"layers": []
}
],
"inactive": [
{
"id": "2"
}
],
"layers": [
{
"encodingId": "1",
"simulcastIdx": 1,
"spatialLayerId": 255,
"temporalLayerId": 255,
"bitrate": 306776
},
{
"encodingId": "0",
"simulcastIdx": 0,
"spatialLayerId": 255,
"temporalLayerId": 255,
"bitrate": 105784
}
]
}
}
}
}
{
"type": "event",
"name": "stopped",
"data": {
"streamId": "xRp7nh/ams",
"reason": "viewer-stopped"
}
}
Channel for subscribers
Messages sent from the viewer to the service.
Accepts the following message:
Type of message used by the viewer client to send a command to the signaling server and receive a response. It is typically used when the viewer client wants to control their viewing experience, such as selecting a different stream, muting the audio, or switching between different projections.
Each command sent by the viewer client must include a transaction identifier, or "transID", which allows the client to match the response or error received from the server to the original command.
{
"type": "cmd",
"transId": 0,
"name": "view",
"data": {
"sdp": "sdp",
"streamId": "l9i3sb96",
"events": [
"active",
"inactive",
"layers",
"viewercount"
]
}
}
{
"type": "cmd",
"transId": 6,
"name": "mute",
"data": {
"muted": true,
"kind": "audio"
}
}
{
"type": "cmd",
"transId": 1,
"name": "unview",
"data": {}
}
{
"type": "cmd",
"transId": 1,
"name": "project",
"data": {
"sourceId": "test",
"mapping": [
{
"trackId": "video",
"mediaId": "null"
}
]
}
}
{
"type": "cmd",
"transId": 7,
"name": "unproject",
"data": {
"mediaIds": [
1
]
}
}
{
"type": "cmd",
"transId": 3,
"name": "select",
"data": {
"layer": {
"encodingId": "0"
}
}
}
Channel for subscribers
Messages the viewer receives from the service.
Accepts one of the following messages:
This message type is used by the server to respond to commands sent by the client viewer, and includes custom data associated with the response.
For certain command types, including project, unproject, select, unview, mute, record, and unrecord, no data field is necessary for the response. The specific payload structure may vary depending on the type of command sent by the client viewer.
{
"type": "response",
"transId": 0,
"data": {
"sdp": "sdp",
"subscriberId": "2bebebf36c6143b8b9a7431a16432d09",
"clusterId": "do-sfo-legacy",
"streamId": "KQkaGG/l9i3sb96",
"streamViewId": "e6cda950-2d0c-4e9d-b4e6-e3ba7896e1aa"
}
}
{
"type": "response",
"transId": 1,
"data": {
"sdp": "sdp",
"subscriberId": "ae0262e06ff6420db0c1b08da9887202",
"clusterId": "do-sfo-legacy",
"streamId": "udAcdT/lbxyfxso"
}
}
It is used to reject a command sent by the other peer and pass some custom data associated to the error.
{
"type": "error",
"transId": 3,
"data": "Internal Server Error"
}
Event messages are used when the sending side does not expect any kind of response back. Events can occur at any time.
{
"type": "event",
"name": "viewercount",
"data": {
"viewerCount": 0
}
}
{
"type": "event",
"name": "active",
"data": {
"streamId": "udAcdT/lbxyfxso",
"sourceId": "null",
"tracks": [
{
"trackId": "audio",
"media": "audio"
},
{
"trackId": "video",
"media": "video"
}
]
}
}
{
"type": "event",
"name": "inactive",
"data": {
"streamId": "udAcdT/lbxyfxso",
"sourceId": "null"
}
}
{
"type": "event",
"name": "layers",
"data": {
"medias": {
"0": {
"active": [
{
"id": "1",
"simulcastIdx": 1,
"bitrate": 306776,
"layers": []
},
{
"id": "0",
"simulcastIdx": 0,
"bitrate": 105784,
"layers": []
}
],
"inactive": [
{
"id": "2"
}
],
"layers": [
{
"encodingId": "1",
"simulcastIdx": 1,
"spatialLayerId": 255,
"temporalLayerId": 255,
"bitrate": 306776
},
{
"encodingId": "0",
"simulcastIdx": 0,
"spatialLayerId": 255,
"temporalLayerId": 255,
"bitrate": 105784
}
]
}
}
}
}
{
"type": "event",
"name": "stopped",
"data": {
"streamId": "xRp7nh/ams",
"reason": "viewer-stopped"
}
}
Type of message used by the broadcaster client to send a command to the signaling server and receive a response. It is used when the sending side expects a response from the other side as a result of this command
It requires a transaction identifier (transID) to match responses with their corresponding commands.
The command name field determines the structure and content of the 'data' field, which varies based on the type of command being sent.
Type of message used by the viewer client to send a command to the signaling server and receive a response. It is typically used when the viewer client wants to control their viewing experience, such as selecting a different stream, muting the audio, or switching between different projections.
Each command sent by the viewer client must include a transaction identifier, or "transID", which allows the client to match the response or error received from the server to the original command.
Type of message sent by the signaling server as a response to a command sent by the broadcaster client. It is used to confirm the acceptance of the command and provide additional data associated with the response.
The content of the 'payload' field in the response message can vary depending on the type of command message that was sent by the broadcaster.
This message type is used by the server to respond to commands sent by the client viewer, and includes custom data associated with the response.
For certain command types, including project, unproject, select, unview, mute, record, and unrecord, no data field is necessary for the response. The specific payload structure may vary depending on the type of command sent by the client viewer.
It is used to reject a command sent by the other peer and pass some custom data associated to the error.
Event messages are used when the sending side does not expect any kind of response back. Events can occur at any time.
This is a demonstration of how layer selection works between the viewer and signaling server.
The interaction is shown in this sequence diagram:
This is a demonstration of how multiview works both between the signaling server with the Viewer and the Broadcaster.
Used to perform SDP signaling to publish a stream.
Used to gracefully terminate the connection with the server.
Used to perform SDP signaling to connect a viewer.
Used to gracefully terminate the connection with the server. Needs to pass an empty object.
See the description of the current connection. Used to see the final SDP, connected cluster, streamId, and suscriberId.
Needs to pass an empty object
Allows muting the audio or video stream (The server doesn't send the stream as opposed to local muting). It doesn't seem to work for video
Allows selection of simulcast video layer. Select a layer with encodingId (encodingId is obtained from the data field of an event-type message).
Way of selecting shat source is connected to what WebRTC stream.
Not sure if it works (Seems to do nothing)
Type of message used to record a stream.
Type of message used to unrecord a stream.
The purpose of this message is to confirm that a previous publish message has been received and processed correctly by the API, and to provide additional information related to the publication.
The purpose of this message is to confirm the successful processing of a request to view a data stream and provide additional information related to the stream view.
The purpose of this message is to confirm that the previous describe command has been received and processed correctly and to provide detailed information about a specific data stream.
Fires when the viewer counts changes.
Fires when the live stream is active, or has started broadcasting.
This event is sent when the stream stops broadcasting but is still available.
This event is sent when the stream is stopped.
When broadcasting with simulcast, this events fires when there is an update of the state of the layers in a stream.
This event is sent when the server is having problems, is shutting down or when viewers need to move for load balancing purposes.
This event is sent when using multiplexed tracks for audio.