the instance of RTC service
the peer connection id assigned by the parent RTC module.
the signaling layer instance
The {@code RTCConfiguration} to use for the WebRTC peer connection.
WebRTC 'PeerConnection' constraints
indicates whether or not the new instance will be used in a peer to peer connection.
TracablePeerConnection config options.
Quality settings to applied on the outbound audio stream.
if set to true, lower layers will be disabled for screenshare.
codec settings to be applied for video streams.
if set to 'true' will disable the simulcast.
if set to 'true' will disable the RTX.
set to true when the insertable streams constraints is to be enabled on the PeerConnection.
If set to true, the browser will generate only Relay ICE candidates.
If set to 'true' no audio will be sent or received.
Quality settings to applied on the outbound video streams.
FIXME: initially the purpose of TraceablePeerConnection was to be able to debug the peer connection. Since many other responsibilities have been added it would make sense to extract a separate class from it and come up with a more suitable name.
Optional
onconnectionstatechangeOptional
ondatachannelOptional
onicecandidateOptional
oniceconnectionstatechangeOptional
onnegotiationneededOptional
onsignalingstatechangeOptional
statsintervalStatic
dumpSDPReturns a string representation of a SessionDescription object.
Gets the connection state of the peer connection.
Gets the ICE connection state of the peer connection.
Gets the local description of the peer connection, with optional transformations for simulcast and stream identifiers.
Gets the remote description of the peer connection, with optional adjustments for media direction in P2P mode.
Gets the signaling state of the peer connection.
Initializes a new JitsiRemoteTrack instance with the data provided by the signaling layer and SDP.
The owner's endpoint ID (MUC nickname)
The track's source name
The track's details.
Checks if screensharing is in progress.
Returns true if a desktop track has been added to the peerconnection, false otherwise.
Processes the local SDP and creates an SSRC map for every local track.
SDP from the local description.
Called on "track added" and "stream added" PeerConnection events (because we handle streams on per track basis). Finds the owner and the SSRC for the track and passes that to ChatRoom for further processing.
the WebRTC MediaStream instance which is the parent of the track
the WebRTC MediaStreamTrack added for remote participant.
the WebRTC transceiver that is created for the remote participant in unified plan.
Handles remote media track removal.
WebRTC MediaStream instance which is the parent of the track.
WebRTC MediaStreamTrack which has been removed from the PeerConnection.
Removes and disposes given JitsiRemoteTrack instance. Emits RTCEvents.REMOTE_TRACK_REMOVED.
The remote track to be removed.
Sends a stats entry to the rtcstats server about the mute state change for local track.
The local track.
muted state.
Adds an ICE candidate to the peer connection.
Track the SSRCs seen so far.
SSRC.
Add JitsiLocalTrack to this TPC.
indicates if the endpoint is the offerer.
Adds local track to the RTCPeerConnection.
the track to be added to the pc.
Promise that resolves to true if the underlying PeerConnection's state has changed and renegotiation is required, false if no renegotiation is needed or Promise is rejected when something goes wrong.
Returns the expected send resolution for a local video track based on what encodings are currently active.
The local video track.
Closes underlying WebRTC PeerConnection instance and removes all remote tracks by emitting RTCEvents.REMOTE_TRACK_REMOVED for each one of them.
Configures the stream encodings for the audio tracks that are added to the peerconnection.
The local audio track.
promise that will be resolved when the operation is successful and rejected otherwise.
Configures the stream encodings depending on the video type, scalability mode and the bitrate settings for the codec that is currently selected.
promise that will be resolved when the operation is successful and rejected otherwise.
Creates an SDP answer for the peer connection based on the provided constraints.
Creates a new data channel on the peer connection with the specified label and options.
Creates an SDP offer for the peer connection based on the provided constraints.
Checks if the browser is currently doing true simulcast where in three different media streams are being sent to the bridge. Currently this happens always for VP8 and only if simulcast is enabled for VP9/AV1/H264.
The local video track.
Returns the receiver corresponding to the given MediaStreamTrack.
The media stream track used for the search.
Returns the sender corresponding to the given MediaStreamTrack.
The media stream track used for the search.
Obtains audio levels of the remote audio tracks by getting the source information on the RTCRtpReceivers. The information relevant to the ssrc is updated each time a RTP packet constaining the ssrc is received.
list of endpoint ids for which audio levels are to be gathered.
containing ssrc and audio level information as a key-value pair.
Returns the codecs in the current order of preference as configured on the peerconnection.
Optional
description: RTCSessionDescriptionForwards the peerconnection.iceConnectionState state except that it will convert "completed" into "connected" where both mean that the ICE has succeeded and is up and running. We never see "completed" state for the JVB connection, but it started appearing for the P2P one. This method allows to adapt old logic to this new situation.
Obtains local tracks for given MediaType. If the mediaType argument is omitted the list of all local tracks will be returned.
Optional
mediaType: MediaType = undefinedReturns the SSRCs associated with a given local video track.
Returns a map of source names and their associated SSRCs for the remote participant.
Endpoint id of the remote participant.
The map of source names and their associated SSRCs.
Returns the remote sourceInfo for a given source name.
The source name.
Obtains all remote tracks currently known to this PeerConnection instance.
Optional
endpointId: string = undefinedThe track owner's identifier (MUC nickname)
Optional
mediaType: MediaType = undefinedThe remote tracks will be filtered by their media type if this argument is specified.
Tries to find SSRC number for given JitsiTrack id. It will search both local and remote tracks bound to this instance.
Obtains call-related stats from the peer connection.
Promise which resolves with data providing statistics about the peerconnection.
Returns the target bitrates configured for the local video source.
Tries to find JitsiTrack for given SSRC number. It will search both local and remote tracks bound to this instance.
Tells whether or not this TPC instance has spatial scalability enabled.
true if spatial scalability is enabled and active or false if it's turned off.
Processes the local description SDP and caches the mids of the mlines associated with the given tracks.
local tracks that are added to the peerconnection.
Remove local track from this TPC.
the track to be removed from this TPC.
FIXME It should probably remove a boolean just like removeTrackFromPc The same applies to addTrack.
Removes local track from the RTCPeerConnection.
the local track to be removed.
Promise that resolves to true if the underlying PeerConnection's state has changed and renegotiation is required, false if no renegotiation is needed or Promise is rejected when something goes wrong.
Replaces oldTrack with newTrack from the peer connection. Either oldTrack or newTrack can be null; replacing a valid oldTrack with a null newTrack effectively just removes oldTrack
The current track in use to be replaced on the pc.
The new track to be used.
Whether the operation is a mute/unmute operation.
Sends DTMF tones if possible.
The DTMF tones string as defined by {@code RTCDTMFSender.insertDTMF}, 'tones' argument.
The amount of time in milliseconds that each DTMF should last. It's 200ms by default.
The length of time in miliseconds to wait between tones. It's 200ms by default.
Enables or disables simulcast for screenshare based on the frame rate requested for desktop track capture.
framerate to be used for desktop track capture.
Sets the local description on the peerconnection.
The local description to be set.
Resumes or suspends media on the peerconnection by setting the active state on RTCRtpEncodingParameters associated with all the senders that have a track attached to it.
whether outgoing media needs to be enabled or disabled.
Optional
mediaType: MediaTypemedia type, 'audio' or 'video', if neither is passed, all outgoing media will either be enabled or disabled.
Sets the remote description on the peerconnection.
The remote description to be set.
Changes the resolution of the video stream that is sent to the peer based on the resolution requested by the peer and user preference, sets the degradation preference on the sender based on the video type, configures the maximum bitrates on the send stream.
The max frame height to be imposed on the outgoing video stream.
Optional
preferredCodec: CodecMimeTypepromise that will be resolved when the operation is successful and rejected otherwise.
Sets the codec preference on the peerconnection. The codec preference goes into effect when the next renegotiation happens for older clients that do not support the codec selection API.
Preferred codecs for video.
The preferred codec for screenshare.
Enables/disables outgoing video media transmission on this peer connection. When disabled the stream encoding's active state is enabled or disabled to send or stop the media.
true to enable video media transmission or false to disable. If the value is not a boolean the call will have no effect.
A promise that is resolved when the change is succesful, rejected otherwise.
Creates a text representation of this TraceablePeerConnection instance.
Updates the remote source map with the given source map for adding or removing sources.
The map of source names to their corresponding SSRCs.
Whether the sources are being added or removed.
Returns true if the codec selection API is used for switching between codecs for the video sources.
Creates new instance of 'TraceablePeerConnection'.