Constructor
new Signaling(options)
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | General signaling options. Properties
|
- Source
const millicastSignaling = new Signaling(options)
Extends
- EventEmitter
Methods
close()
Close WebSocket connection with Millicast server.
- Source
millicastSignaling.close()
(async) cmd(cmd, dataopt) → {Promise.<Object>}
Send command to the server.
Name | Type | Attributes | Description |
---|---|---|---|
cmd | String | Command name. | |
data | Object | <optional> | Command parameters. |
- Source
Promise object which represents the command response.
- Type:
- Promise.<Object>
(async) connect() → {Promise.<WebSocket>}
Starts a WebSocket connection with signaling server.
- Source
Promise object which represents the WebSocket object of the establshed connection.
- Type:
- Promise.<WebSocket>
const response = await millicastSignaling.connect()
(async) publish(sdp, options) → {Promise.<String>}
Establish WebRTC connection with Millicast Server as Publisher role.
Name | Type | Description |
---|---|---|
sdp | String | The SDP information created by your offer. |
options | SignalingPublishOptions | Signaling Publish Options. |
- Source
Promise object which represents the SDP command response.
- Type:
- Promise.<String>
const response = await millicastSignaling.publish(sdp, {codec: 'h264'})
(async) subscribe(sdp, options) → {Promise.<String>}
Establish WebRTC connection with Millicast Server as Subscriber role.
Name | Type | Description |
---|---|---|
sdp | String | The SDP information created by your offer. |
options | SignalingSubscribeOptions | Signaling Subscribe Options. |
- Source
Promise object which represents the SDP command response.
- Type:
- Promise.<String>
const response = await millicastSignaling.subscribe(sdp)
Events
broadcastEvent
Passthrough of available Millicast broadcast events.
Active - Fires when the live stream is, or has started broadcasting.
Inactive - Fires when the stream has stopped broadcasting, but is still available.
Stopped - Fires when the stream has stopped for a given reason.
Vad - Fires when using multiplexed tracks for audio.
Layers - Fires when there is an update of the state of the layers in a stream (when broadcasting with simulcast).
Migrate - Fires when the server is having problems, is shutting down or when viewers need to move for load balancing purposes.
Viewercount - Fires when the viewer count changes.
Updated - when an active stream's tracks are updated
More information here: https://docs.dolby.io/streaming-apis/docs/web#broadcast-events
- Object
Name | Type | Description |
---|---|---|
type | String | In this case the type of this message is "event". |
name | "active" | | Event name. |
data | Object | Custom event data. |
- Source
wsConnectionClose
WebSocket connection with signaling server was successfully closed.
- Source
wsConnectionError
WebSocket connection failed with signaling server. Returns url of WebSocket
- String
- Source
wsConnectionSuccess
WebSocket connection was successfully established with signaling server.
- Object
Name | Type | Description |
---|---|---|
ws | WebSocket | WebSocket object which represents active connection. |
tm | TransactionManager | TransactionManager object that simplify WebSocket commands. |
- Source