lib-jitsi-meet
    Preparing search index...

    Creates new instance of 'TraceablePeerConnection'.

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Parameters

      • rtc: RTC

        the instance of RTC service

      • id: number

        the peer connection id assigned by the parent RTC module.

      • signalingLayer: SignalingLayer

        the signaling layer instance

      • pcConfig: RTCConfiguration

        The {@code RTCConfiguration} to use for the WebRTC peer connection.

      • constraints: { optional?: any[] }

        WebRTC 'PeerConnection' constraints

      • isP2P: boolean

        indicates whether or not the new instance will be used in a peer to peer connection.

      • options: ITPCOptions

        TracablePeerConnection config options.

        • audioQuality

          Quality settings to applied on the outbound audio stream.

        • capScreenshareBitrate

          if set to true, lower layers will be disabled for screenshare.

        • codecSettings

          codec settings to be applied for video streams.

        • disableSimulcast

          if set to 'true' will disable the simulcast.

        • disableRtx

          if set to 'true' will disable the RTX.

        • enableInsertableStreams

          set to true when the insertable streams constraints is to be enabled on the PeerConnection.

        • forceTurnRelay

          If set to true, the browser will generate only Relay ICE candidates.

        • startSilent

          If set to 'true' no audio will be sent or received.

        • videoQuality

          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.

      Returns TraceablePeerConnection

    Properties

    audioTransferActive: boolean
    codecSettings: ICodecSettings
    eventEmitter: EventEmitter
    id: number
    isP2P: boolean
    localSdpMunger: LocalSdpMunger
    localSSRCs: Map<number, ISsrcInfo>
    localTracks: Map<number, JitsiLocalTrack>
    localTrackTransceiverMids: Map<number, string>
    maxstats: number
    onconnectionstatechange?: (event: Event) => void
    ondatachannel?: (event: RTCDataChannelEvent) => void
    onicecandidate?: (event: RTCPeerConnectionIceEvent) => void
    oniceconnectionstatechange?: (event: Event) => void
    onnegotiationneeded?: (event: Event) => void
    onsignalingstatechange?: (event: Event) => void
    onTrack: (evt: RTCTrackEvent) => void
    options: ITPCOptions
    peerconnection: RTCPeerConnection
    remoteSources: Map<string, number>
    remoteSSRCs: Set<number>
    remoteTracks: Map<string, Map<MediaType, Set<JitsiRemoteTrack>>>
    remoteTracksBySsrc: Map<number, JitsiRemoteTrack>
    rtc: RTC
    rtxModifier: RtxModifier
    simulcast: SdpSimulcast
    stats: Record<string, IStatsEntry>
    statsinterval?: number
    tpcUtils: TPCUtils
    trace: ITraceFunction
    updateLog: IUpdateLogEntry[]
    videoTransferActive: boolean
    dumpSDP: (description: RTCSessionDescription) => string = ...

    Returns a string representation of a SessionDescription object.

    Accessors

    • get localDescription(): RTCSessionDescription

      Gets the local description of the peer connection, with optional transformations for simulcast and stream identifiers.

      Returns RTCSessionDescription

    • get remoteDescription(): RTCSessionDescription

      Gets the remote description of the peer connection, with optional adjustments for media direction in P2P mode.

      Returns RTCSessionDescription

    Methods

    • Initializes a new JitsiRemoteTrack instance with the data provided by the signaling layer and SDP.

      Parameters

      • ownerEndpointId: any

        The owner's endpoint ID (MUC nickname)

      • sourceName: any

        The track's source name

      • trackDetails: any

        The track's details.

      Returns void

    • Checks if screensharing is in progress.

      Returns boolean

      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.

      Parameters

      • localSDP: string

        SDP from the local description.

      Returns void

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

      Parameters

      • stream: MediaStream

        the WebRTC MediaStream instance which is the parent of the track

      • track: MediaStreamTrack

        the WebRTC MediaStreamTrack added for remote participant.

      • transceiver: RTCRtpTransceiver = null

        the WebRTC transceiver that is created for the remote participant in unified plan.

      Returns void

    • Handles remote media track removal.

      Parameters

      • stream: MediaStream

        WebRTC MediaStream instance which is the parent of the track.

      • track: MediaStreamTrack

        WebRTC MediaStreamTrack which has been removed from the PeerConnection.

      Returns void

    • Adds an ICE candidate to the peer connection.

      Parameters

      • candidate: RTCIceCandidate

      Returns Promise<void>

    • Adds local track to the RTCPeerConnection.

      Parameters

      Returns Promise<boolean>

      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.

    • Closes underlying WebRTC PeerConnection instance and removes all remote tracks by emitting RTCEvents.REMOTE_TRACK_REMOVED for each one of them.

      Returns void

    • Configures the stream encodings for the audio tracks that are added to the peerconnection.

      Parameters

      Returns Promise<void> | Promise<PromiseSettledResult<void>[]>

      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.

      Parameters

      Returns Promise<void> | Promise<PromiseSettledResult<void>[]>

      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.

      Parameters

      • constraints: RTCOfferOptions

      Returns Promise<RTCSessionDescription>

    • Creates a new data channel on the peer connection with the specified label and options.

      Parameters

      • label: string
      • opts: RTCDataChannelInit

      Returns RTCDataChannel

    • Creates an SDP offer for the peer connection based on the provided constraints.

      Parameters

      • constraints: RTCOfferOptions

      Returns Promise<RTCSessionDescription>

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

      Parameters

      Returns boolean

    • Returns the receiver corresponding to the given MediaStreamTrack.

      Parameters

      • track: MediaStreamTrack

        The media stream track used for the search.

      Returns RTCRtpReceiver

      • The found receiver or undefined if no receiver was found.
    • Returns the sender corresponding to the given MediaStreamTrack.

      Parameters

      • track: MediaStreamTrack

        The media stream track used for the search.

      Returns RTCRtpSender

      • The found sender or undefined if no sender was found.
    • 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.

      Parameters

      • speakerList: string[] = []

        list of endpoint ids for which audio levels are to be gathered.

      Returns Record<string, number>

      containing ssrc and audio level information as a key-value pair.

    • Forwards 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.

      Returns RTCIceConnectionState

    • Returns a map of source names and their associated SSRCs for the remote participant.

      Parameters

      • id: string

        Endpoint id of the remote participant.

      Returns Map<string, ITPCSourceInfo>

      The map of source names and their associated SSRCs.

    • Returns the remote sourceInfo for a given source name.

      Parameters

      • sourceName: string

        The source name.

      Returns ITPCSourceInfo

    • Obtains call-related stats from the peer connection.

      Returns Promise<RTCStatsReport>

      Promise which resolves with data providing statistics about the peerconnection.

    • Tells whether or not this TPC instance has spatial scalability enabled.

      Returns boolean

      true if spatial scalability is enabled and active or false if it's turned off.

    • Removes local track from the RTCPeerConnection.

      Parameters

      Returns Promise<boolean>

      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

      Parameters

      • oldTrack: JitsiLocalTrack

        The current track in use to be replaced on the pc.

      • newTrack: JitsiLocalTrack

        The new track to be used.

      • isMuteOperation: boolean = false

        Whether the operation is a mute/unmute operation.

      Returns Promise<boolean>

      • If the promise resolves with true, renegotiation will be needed. Otherwise no renegotiation is needed.
    • Sends DTMF tones if possible.

      Parameters

      • tones: string

        The DTMF tones string as defined by {@code RTCDTMFSender.insertDTMF}, 'tones' argument.

      • duration: number = 200

        The amount of time in milliseconds that each DTMF should last. It's 200ms by default.

      • interToneGap: number = 200

        The length of time in miliseconds to wait between tones. It's 200ms by default.

      Returns void

    • Enables or disables simulcast for screenshare based on the frame rate requested for desktop track capture.

      Parameters

      • maxFps: number

        framerate to be used for desktop track capture.

      Returns void

    • Sets the local description on the peerconnection.

      Parameters

      • description: RTCSessionDescription

        The local description to be set.

      Returns Promise<void>

      • Resolved when the operation is successful and rejected with an error otherwise.
    • 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.

      Parameters

      • enable: boolean

        whether outgoing media needs to be enabled or disabled.

      • OptionalmediaType: MediaType

        media type, 'audio' or 'video', if neither is passed, all outgoing media will either be enabled or disabled.

      Returns Promise<void>

      • A promise that is resolved when the change is succesful on all the senders, rejected otherwise.
    • Sets the remote description on the peerconnection.

      Parameters

      • description: RTCSessionDescription

        The remote description to be set.

      Returns Promise<void>

      • Resolved when the operation is successful and rejected with an error otherwise.
    • 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.

      Parameters

      • frameHeight: number

        The max frame height to be imposed on the outgoing video stream.

      • localVideoTrack: JitsiLocalTrack
      • OptionalpreferredCodec: CodecMimeType

      Returns Promise<void>

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

      Parameters

      Returns boolean

      • Returns true if the codec settings were updated, false otherwise.
    • 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.

      Parameters

      • active: boolean

        true to enable video media transmission or false to disable. If the value is not a boolean the call will have no effect.

      Returns Promise<void>

      A promise that is resolved when the change is succesful, rejected otherwise.

    • Updates the remote source map with the given source map for adding or removing sources.

      Parameters

      • sourceMap: Map<string, ITPCSourceInfo>

        The map of source names to their corresponding SSRCs.

      • isAdd: boolean

        Whether the sources are being added or removed.

      Returns void