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
addPeerEvents(instanceClass, peer)
Emits peer events.
Name | Type | Description |
---|---|---|
instanceClass | PeerConnection | PeerConnection instance. |
peer | RTCPeerConnection | Peer instance. |
- Source
extractH26xMetadata(encodedFrame, codec) → {FrameMetaData}
Extract user unregistered metadata from H26x Encoded Frame
Name | Type | Description |
---|---|---|
encodedFrame | RTCEncodedFrame | |
codec | 'H264' | |
- Source
- Type:
- FrameMetaData
parseWebRTCStats(webRTCStats)
Parses incoming WebRTC statistics This method takes statistical data from @dolbyio/webrtc-stats and transforms it into a structured format compatible with previous versions.
Name | Type | Description |
---|---|---|
webRTCStats | Object | The statistics object containing various WebRTC stats |
- Source
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
DRMOptions
the options for DRM playback
- Object
Name | Type | Attributes | Description |
---|---|---|---|
keyId | String | 16-byte KeyID, in lowercase hexadecimal without separators | |
iv | String | 16-byte initialization vector, in lowercase hexadecimal without separators / /** | |
videoElement | HTMLVideoElement | the video HTML element | |
videoEncryptionParams | EncryptionParameters | the video encryption parameters | |
videoMid | String | the video media ID of RTCRtpTransceiver | |
audioElement | HTMLAudioElement | the audio HTML audioElement | |
audioEncryptionParams | EncryptionParameters | <optional> | the audio encryption parameters |
audioMid | String | <optional> | the audio media ID of RTCRtpTransceiver |
mediaBufferMs | Number | <optional> | average target latency in milliseconds |
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
FrameMetaData
Metadata of the Encoded Frame
- object
Name | Type | Attributes | Description |
---|---|---|---|
timestamp | number | the time at which frame sampling started, value is a positive integer containing the sampling instant of the first byte in this frame, in microseconds | |
seiUserUnregisteredDataArray | Array.<SEIUserUnregisteredData> | the SEI user unregistered data array | |
seiPicTimingTimeCodeArray | Array.<SEIPicTimingTimeCode> | <optional> | the SEI pic timing time codes |
- 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. |
keyFramesDecoded | Number | <optional> | Total number of key frames that have been decoded if it's video report. |
framesDecoded | Number | <optional> | Total number of frames that have been decoded if it's video report. |
framesDropped | Number | <optional> | Total number of frames that have been dropped if it's video report. |
framesReceived | Number | <optional> | Total number of frames that have been received 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 Bytes per second. | |
bitrateBitsPerSecond | Number | Current bitrate in bits per second. | |
packetRate | Number | The rate at which packets are being received, measured in packets per second. | |
jitterBufferDelay | Number | Total delay in seconds currently experienced by the jitter buffer. | |
jitterBufferEmittedCount | Number | Total number of packets emitted from the jitter buffer. |
- 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 | Attributes | 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. | |
drmObject | DRMObject | <optional> | DRM proxy server information. |
- 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 Bytes per second. | |
bitrateBitsPerSecond | Number | Current bitrate in bits per second. | |
bytesSentDelta | Number | Change in the number of bytes sent since the last report. | |
totalPacketsSent | Number | Total number of packets sent. | |
packetsSentDelta | Number | Change in the number of packets sent since the last report. | |
packetRate | Number | Rate at which packets are being sent, measured in packets per second. | |
targetBitrate | Number | The target bitrate for the encoder, in bits per second. | |
retransmittedPacketsSent | Number | Total number of retransmitted packets sent. | |
retransmittedPacketsSentDelta | Number | Change in the number of retransmitted packets sent since the last report. | |
retransmittedBytesSent | Number | Total number of bytes that have been retransmitted. | |
retransmittedBytesSentDelta | Number | Change in the number of retransmitted bytes sent since the last report. | |
framesSent | Number | Total number of frames sent (applicable for video). | |
qualityLimitationDurations | Object | <optional> | Durations in seconds for which the quality of the media has been limited by the codec, categorized by the limitation reasons such as bandwidth, CPU, or other factors. |
- Source
SEIPicTimingTimeCode
SEI Pic timing time code
- object
Name | Type | Description |
---|---|---|
seconds | number | |
minutes | number | |
hours | number | |
n_frames | number | |
time_offset | number |
- Source
SEIUserUnregisteredData
SEI User unregistered data
- object
Name | Type | Description |
---|---|---|
uuid | string | the UUID of the SEI user unregistered data |
data | Uint8Array | the binary content of the SEI user unregistered data |
- 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" | "updated"). |
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>