Members
(constant) AudioCodec :String
Enum of Millicast supported Audio codecs
- String
Name | Type | Description |
---|---|---|
OPUS | String | |
MULTIOPUS | String |
- Source
(constant) VideoCodec :String
Enum of Millicast supported Video codecs
- String
Name | Type | Description |
---|---|---|
VP8 | String | |
VP9 | String | |
H264 | String | |
AV1 | String | |
H265 | String | Only available in Safari |
- Source
Methods
addCandidateReport(report, statsObject)
Parse and add incoming candidate-pair report from RTCPeerConnection to final report. Also adds associated local-candidate data to report.
Name | Type | Description |
---|---|---|
report | Object | JSON object which represents a report from RTCPeerConnection stats. |
statsObject | Object | Current stats object being parsed. |
- Source
addInboundRtpReport(report, previousStats, statsObject)
Parse and add incoming inbound-rtp report from RTCPeerConnection to final report.
Name | Type | Description |
---|---|---|
report | Object | JSON object which represents a report from RTCPeerConnection stats. |
previousStats | ConnectionStats | Previous stats parsed. |
statsObject | Object | Current stats object being parsed. |
- Source
addOutboundRtpReport(report, previousStats, statsObject)
Parse and add incoming outbound-rtp report from RTCPeerConnection to final report.
Name | Type | Description |
---|---|---|
report | Object | JSON object which represents a report from RTCPeerConnection stats. |
previousStats | ConnectionStats | Previous stats parsed. |
statsObject | Object | Current stats object being parsed. |
- Source
addPeerEvents(instanceClass, peer)
Emits peer events.
Name | Type | Description |
---|---|---|
instanceClass | PeerConnection | PeerConnection instance. |
peer | RTCPeerConnection | Peer instance. |
- Source
calculatePacketsLostDelta(actualReport, previousReport) → {Number}
Calculate the delta packets lost
Name | Type | Description |
---|---|---|
actualReport | Object | JSON object which represents a parsed report. |
previousReport | Object | JSON object which represents a parsed report. |
- Source
Packets lost ratio
- Type:
- Number
calculatePacketsLostRatio(actualReport, previousReport) → {Number}
Calculate the ratio packets lost
Name | Type | Description |
---|---|---|
actualReport | Object | JSON object which represents a parsed report. |
previousReport | Object | JSON object which represents a parsed report. |
- Source
Packets lost ratio
- Type:
- Number
getBaseRtpReportData(report, mediaType) → {Object}
Get common information for RTP reports.
Name | Type | Description |
---|---|---|
report | Object | JSON object which represents a report from RTCPeerConnection stats. |
mediaType | String | Media type. |
- Source
Object containing common information.
- Type:
- Object
getCodecData(codecReportId, rawStats) → {Object}
Get codec information from stats.
Name | Type | Description |
---|---|---|
codecReportId | String | Codec report ID. |
rawStats | RTCStatsReport | RTCPeerConnection stats. |
- Source
Object containing codec information.
- Type:
- Object
getMediaType(report) → {String}
Get media type.
Name | Type | Description |
---|---|---|
report | Object | JSON object which represents a report from RTCPeerConnection stats. |
- Source
Media type.
- Type:
- String
Type Definitions
ConnectionStats
- Object
Name | Type | Description |
---|---|---|
raw | RTCStatsReport | All RTCPeerConnection stats without parsing. Reference https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport. |
audio | TrackReport | Parsed audio information. |
video | TrackReport | Parsed video information. |
availableOutgoingBitrate | Number | The available outbound capacity of the network connection. The higher the value, the more bandwidth you can assume is available for outgoing data. The value is reported in bits per second. This value comes from the nominated candidate-pair. |
totalRoundTripTime | Number | Total round trip time is the total time in seconds that has elapsed between sending STUN requests and receiving the responses. This value comes from the nominated candidate-pair. |
currentRoundTripTime | Number | Current round trip time indicate the number of seconds it takes for data to be sent by this peer to the remote peer and back over the connection described by this pair of ICE candidates. This value comes from the nominated candidate-pair. |
candidateType | RTCIceCandidateType | Local candidate type from the nominated candidate-pair which indicates the type of ICE candidate the object represents. |
- Source
DirectorPublisherOptions
- Object
Name | Type | Attributes | Description |
---|---|---|---|
token | String | Millicast Publishing Token. | |
streamName | String | Millicast Stream Name. | |
streamType | "WebRtc" | | <optional> | Millicast Stream Type. |
- Source
DirectorSubscriberOptions
- Object
Name | Type | Attributes | Description |
---|---|---|---|
streamName | String | Millicast publisher Stream Name. | |
streamAccountId | String | Millicast Account ID. | |
subscriberToken | String | <optional> | Token to subscribe to secure streams. If you are subscribing to an unsecure stream, you can omit this param. |
- Source
InboundStats
- Object
Name | Type | Attributes | Description |
---|---|---|---|
id | String | inbound-rtp Id. | |
jitter | Number | Current Jitter measured in seconds. | |
mimeType | String | <optional> | Mime type if related report had codec report associated. |
framesPerSecond | Number | <optional> | Current framerate if it's video report. |
frameHeight | Number | <optional> | Current frame height if it's video report. |
frameWidth | Number | <optional> | Current frame width if it's video report. |
timestamp | Number | Timestamp of report. | |
totalBytesReceived | Number | Total bytes received is an integer value which indicates the total number of bytes received so far from this synchronization source. | |
totalPacketsReceived | Number | Total packets received indicates the total number of packets of any kind that have been received on the connection described by the pair of candidates. | |
totalPacketsLost | Number | Total packets lost. | |
packetsLostRatioPerSecond | Number | Total packet lost ratio per second. | |
packetsLostDeltaPerSecond | Number | Total packet lost delta per second. | |
bitrate | Number | Current bitrate in bits per second. |
- Source
LayerInfo
- Object
Name | Type | Description |
---|---|---|
encodingId | String | rid value of the simulcast encoding of the track (default: automatic selection) |
spatialLayerId | Number | The spatial layer id to send to the outgoing stream (default: max layer available) |
temporalLayerId | Number | The temporaral layer id to send to the outgoing stream (default: max layer available) |
maxSpatialLayerId | Number | Max spatial layer id (default: unlimited) |
maxTemporalLayerId | Number | Max temporal layer id (default: unlimited) |
- Source
LayerInfo
- Object
Name | Type | Description |
---|---|---|
encodingId | String | rid value of the simulcast encoding of the track (default: automatic selection) |
spatialLayerId | Number | The spatial layer id to send to the outgoing stream (default: max layer available) |
temporalLayerId | Number | The temporaral layer id to send to the outgoing stream (default: max layer available) |
maxSpatialLayerId | Number | Max spatial layer id (default: unlimited) |
maxTemporalLayerId | Number | Max temporal layer id (default: unlimited) |
LogLevel
- Object
Name | Type | Description |
---|---|---|
value | Number | The numerical representation of the level. |
name | String | Human readable name of the log level. |
MillicastCapability
- Object
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
codecs | Array.<Object> | Properties
| ||||||||||||||||||||
headerExtensions | Array.<RTCRtpHeaderExtensionCapability> | An array specifying the URI of the header extension, as described in RFC 5285. |
- Source
MillicastDirectorResponse
- Object
Name | Type | Description |
---|---|---|
urls | Array.<String> | WebSocket available URLs. |
jwt | String | Access token for signaling initialization. |
iceServers | Array.<RTCIceServer> | Object which represents a list of Ice servers. |
- Source
MillicastDirectorResponse
- Object
Name | Type | Description |
---|---|---|
urls | Array.<String> | WebSocket available URLs. |
jwt | String | Access token for signaling initialization. |
iceServers | Array.<RTCIceServer> | Object which represents a list of Ice servers. |
- Source
OutboundStats
- Object
Name | Type | Attributes | Description |
---|---|---|---|
id | String | outbound-rtp Id. | |
mimeType | String | <optional> | Mime type if related report had codec report associated. |
framesPerSecond | Number | <optional> | Current framerate if it's video report. |
frameHeight | Number | <optional> | Current frame height if it's video report. |
frameWidth | Number | <optional> | Current frame width if it's video report. |
qualityLimitationReason | String | <optional> | If it's video report, indicate the reason why the media quality in the stream is currently being reduced by the codec during encoding, or none if no quality reduction is being performed. |
timestamp | Number | Timestamp of report. | |
totalBytesSent | Number | Total bytes sent indicates the total number of payload bytes that hve been sent so far on the connection described by the candidate pair. | |
bitrate | Number | Current bitrate in bits per second. |
- Source
SignalingPublishOptions
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
codec | VideoCodec | <optional> | "h264" | Codec for publish stream. |
record | Boolean | <optional> | Enable stream recording. If record is not provided, use default Token configuration. Only available in Tokens with recording enabled. | |
sourceId | String | <optional> | Source unique id. Only available in Tokens with multisource enabled.* | |
events | Array.<String> | Override which events will be delivered by the server ("active" | "inactive"). |
- Source
SignalingSubscribeOptions
- Object
Name | Type | Description |
---|---|---|
vad | String | Enable VAD multiplexing for secondary sources. |
pinnedSourceId | String | Id of the main source that will be received by the default MediaStream. |
excludedSourceIds | Array.<String> | Do not receive media from the these source ids. |
events | Array.<String> | Override which events will be delivered by the server ("active" | "inactive" | "vad" | "layers"). |
layer | LayerInfo | Select the simulcast encoding layer and svc layers for the main video track, leave empty for automatic layer selection based on bandwidth estimation. |
- Source
TrackReport
- Object
Name | Type | Description |
---|---|---|
inbounds | Array.<InboundStats> | Parsed information of each inbound-rtp. |
outbounds | Array.<OutboundStats> | Parsed information of each outbound-rtp. |
- Source
loggerHandler(messages, context)
Callback which handles log messages.
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
messages | Array.<any> | Arguments object with the supplied log messages. | ||||||||||||
context | Object | Properties
|
tokenGeneratorCallback() → {Promise.<MillicastDirectorResponse>}
Callback invoke when a new connection path is needed.
- Source
Promise object which represents the result of getting the new connection path.
You can use your own token generator or use the Director available methods.
- Type:
- Promise.<MillicastDirectorResponse>