Members

(constant) AudioCodec :String

Enum of Millicast supported Audio codecs

Type:
  • String
Properties
NameTypeDescription
OPUSString
MULTIOPUSString

(constant) VideoCodec :String

Enum of Millicast supported Video codecs

Type:
  • String
Properties
NameTypeDescription
VP8String
VP9String
H264String
AV1String
H265String

Only available in Safari

Methods

addPeerEvents(instanceClass, peer)

Emits peer events.

Parameters:
NameTypeDescription
instanceClassPeerConnection

PeerConnection instance.

peerRTCPeerConnection

Peer instance.

extractH26xMetadata(encodedFrame, codec) → {FrameMetaData}

Extract user unregistered metadata from H26x Encoded Frame

Parameters:
NameTypeDescription
encodedFrameRTCEncodedFrame
codec'H264' | 'H265'
Returns:
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.

Parameters:
NameTypeDescription
webRTCStatsObject

The statistics object containing various WebRTC stats

Type Definitions

ConnectionStats

Type:
  • Object
Properties
NameTypeDescription
rawRTCStatsReport

All RTCPeerConnection stats without parsing. Reference https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport.

audioTrackReport

Parsed audio information.

videoTrackReport

Parsed video information.

availableOutgoingBitrateNumber

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.

totalRoundTripTimeNumber

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.

currentRoundTripTimeNumber

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.

candidateTypeRTCIceCandidateType

Local candidate type from the nominated candidate-pair which indicates the type of ICE candidate the object represents.

DirectorPublisherOptions

Type:
  • Object
Properties
NameTypeAttributesDescription
tokenString

Millicast Publishing Token.

streamNameString

Millicast Stream Name.

streamType"WebRtc" | "Rtmp"<optional>

Millicast Stream Type.

DirectorSubscriberOptions

Type:
  • Object
Properties
NameTypeAttributesDescription
streamNameString

Millicast publisher Stream Name.

streamAccountIdString

Millicast Account ID.

subscriberTokenString<optional>

Token to subscribe to secure streams. If you are subscribing to an unsecure stream, you can omit this param.

FrameMetaData

Metadata of the Encoded Frame

Type:
  • object
Properties
NameTypeAttributesDescription
timestampnumber

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

seiUserUnregisteredDataArrayArray.<SEIUserUnregisteredData>

the SEI user unregistered data array

seiPicTimingTimeCodeArrayArray.<SEIPicTimingTimeCode><optional>

the SEI pic timing time codes

InboundStats

Type:
  • Object
Properties
NameTypeAttributesDescription
idString

inbound-rtp Id.

jitterNumber

Current Jitter measured in seconds.

mimeTypeString<optional>

Mime type if related report had codec report associated.

framesPerSecondNumber<optional>

Current framerate if it's video report.

frameHeightNumber<optional>

Current frame height if it's video report.

frameWidthNumber<optional>

Current frame width if it's video report.

keyFramesDecodedNumber<optional>

Total number of key frames that have been decoded if it's video report.

framesDecodedNumber<optional>

Total number of frames that have been decoded if it's video report.

framesDroppedNumber<optional>

Total number of frames that have been dropped if it's video report.

framesReceivedNumber<optional>

Total number of frames that have been received if it's video report.

timestampNumber

Timestamp of report.

totalBytesReceivedNumber

Total bytes received is an integer value which indicates the total number of bytes received so far from this synchronization source.

totalPacketsReceivedNumber

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.

totalPacketsLostNumber

Total packets lost.

packetsLostRatioPerSecondNumber

Total packet lost ratio per second.

packetsLostDeltaPerSecondNumber

Total packet lost delta per second.

bitrateNumber

Current bitrate in bits per second.

packetRateNumber

The rate at which packets are being received, measured in packets per second.

jitterBufferDelayNumber

Total delay in seconds currently experienced by the jitter buffer.

jitterBufferEmittedCountNumber

Total number of packets emitted from the jitter buffer.

LayerInfo

Type:
  • Object
Properties
NameTypeDescription
encodingIdString

rid value of the simulcast encoding of the track (default: automatic selection)

spatialLayerIdNumber

The spatial layer id to send to the outgoing stream (default: max layer available)

temporalLayerIdNumber

The temporaral layer id to send to the outgoing stream (default: max layer available)

maxSpatialLayerIdNumber

Max spatial layer id (default: unlimited)

maxTemporalLayerIdNumber

Max temporal layer id (default: unlimited)

LayerInfo

Type:
  • Object
Properties
NameTypeDescription
encodingIdString

rid value of the simulcast encoding of the track (default: automatic selection)

spatialLayerIdNumber

The spatial layer id to send to the outgoing stream (default: max layer available)

temporalLayerIdNumber

The temporaral layer id to send to the outgoing stream (default: max layer available)

maxSpatialLayerIdNumber

Max spatial layer id (default: unlimited)

maxTemporalLayerIdNumber

Max temporal layer id (default: unlimited)

LogLevel

Type:
  • Object
Properties
NameTypeDescription
valueNumber

The numerical representation of the level.

nameString

Human readable name of the log level.

MillicastCapability

Type:
  • Object
Properties
NameTypeDescription
codecsArray.<Object>
Properties
NameTypeAttributesDescription
codecString

Audio or video codec name.

mimeTypeString

Audio or video codec mime type.

scalabilityModesArray.<String><optional>

In case of SVC support, a list of scalability modes supported.

channelsNumber<optional>

Only for audio, the number of audio channels supported.

headerExtensionsArray.<RTCRtpHeaderExtensionCapability>

An array specifying the URI of the header extension, as described in RFC 5285.

MillicastDirectorResponse

Type:
  • Object
Properties
NameTypeDescription
urlsArray.<String>

WebSocket available URLs.

jwtString

Access token for signaling initialization.

iceServersArray.<RTCIceServer>

Object which represents a list of Ice servers.

MillicastDirectorResponse

Type:
  • Object
Properties
NameTypeDescription
urlsArray.<String>

WebSocket available URLs.

jwtString

Access token for signaling initialization.

iceServersArray.<RTCIceServer>

Object which represents a list of Ice servers.

OutboundStats

Type:
  • Object
Properties
NameTypeAttributesDescription
idString

outbound-rtp Id.

mimeTypeString<optional>

Mime type if related report had codec report associated.

framesPerSecondNumber<optional>

Current framerate if it's video report.

frameHeightNumber<optional>

Current frame height if it's video report.

frameWidthNumber<optional>

Current frame width if it's video report.

qualityLimitationReasonString<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.

timestampNumber

Timestamp of report.

totalBytesSentNumber

Total bytes sent indicates the total number of payload bytes that hve been sent so far on the connection described by the candidate pair.

bitrateNumber

Current bitrate in bits per second.

bytesSentDeltaNumber

Change in the number of bytes sent since the last report.

totalPacketsSentNumber

Total number of packets sent.

packetsSentDeltaNumber

Change in the number of packets sent since the last report.

packetRateNumber

Rate at which packets are being sent, measured in packets per second.

targetBitrateNumber

The target bitrate for the encoder, in bits per second.

retransmittedPacketsSentNumber

Total number of retransmitted packets sent.

retransmittedPacketsSentDeltaNumber

Change in the number of retransmitted packets sent since the last report.

retransmittedBytesSentNumber

Total number of bytes that have been retransmitted.

retransmittedBytesSentDeltaNumber

Change in the number of retransmitted bytes sent since the last report.

framesSentNumber

Total number of frames sent (applicable for video).

qualityLimitationDurationsObject<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.

SEIPicTimingTimeCode

SEI Pic timing time code

Type:
  • object
Properties
NameTypeDescription
secondsnumber
minutesnumber
hoursnumber
n_framesnumber
time_offsetnumber

SEIUserUnregisteredData

SEI User unregistered data

Type:
  • object
Properties
NameTypeDescription
uuidstring

the UUID of the SEI user unregistered data

dataUint8Array

the binary content of the SEI user unregistered data

SignalingPublishOptions

Type:
  • Object
Properties
NameTypeAttributesDefaultDescription
codecVideoCodec<optional>
"h264"

Codec for publish stream.

recordBoolean<optional>

Enable stream recording. If record is not provided, use default Token configuration. Only available in Tokens with recording enabled.

sourceIdString<optional>

Source unique id. Only available in Tokens with multisource enabled.*

eventsArray.<String>

Override which events will be delivered by the server ("active" | "inactive").

SignalingSubscribeOptions

Type:
  • Object
Properties
NameTypeDescription
vadString

Enable VAD multiplexing for secondary sources.

pinnedSourceIdString

Id of the main source that will be received by the default MediaStream.

excludedSourceIdsArray.<String>

Do not receive media from the these source ids.

eventsArray.<String>

Override which events will be delivered by the server ("active" | "inactive" | "vad" | "layers" | "updated").

layerLayerInfo

Select the simulcast encoding layer and svc layers for the main video track, leave empty for automatic layer selection based on bandwidth estimation.

TrackReport

Type:
  • Object
Properties
NameTypeDescription
inboundsArray.<InboundStats>

Parsed information of each inbound-rtp.

outboundsArray.<OutboundStats>

Parsed information of each outbound-rtp.

loggerHandler(messages, context)

Callback which handles log messages.

Parameters:
NameTypeDescription
messagesArray.<any>

Arguments object with the supplied log messages.

contextObject
Properties
NameTypeAttributesDescription
levelLogLevel

The currrent log level.

nameString<nullable>

The optional current logger name.

tokenGeneratorCallback() → {Promise.<MillicastDirectorResponse>}

Callback invoke when a new connection path is needed.

Returns:

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>