lib-jitsi-meet
    Preparing search index...

    Hierarchy

    • default
      • JingleSessionPC
    Index

    Constructors

    • Creates new JingleSessionPC

      Parameters

      • sid: string

        the Jingle Session ID - random string which identifies the session

      • localJid: string

        our JID

      • remoteJid: string

        remote peer JID

      • connection: XmppConnection

        The XMPP connection instance.

      • mediaConstraints: MediaStreamConstraints

        the media constraints object passed to createOffer/Answer, as defined by the WebRTC standard

      • pcConfig: RTCConfiguration

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

      • isP2P: boolean

        indicates whether this instance is meant to be used in a direct, peer to peer connection or false if it's a JVB connection.

      • isInitiator: boolean

        indicates if it will be the side which initiates the session.

      Returns JingleSessionPC

    Properties

    connection: XmppConnection

    The XMPP connection.

    dripContainer: RTCIceCandidate[]

    When dripping is used, stores ICE candidates which are to be sent.

    establishmentDuration: number
    failICE: boolean
    isInitiator: boolean

    Indicates whether this instance is an initiator or an answerer of the Jingle session.

    lasticecandidate: boolean
    localJid: string

    Our JID.

    mediaConstraints: object

    The media constraints object passed to the PeerConnection onCreateAnswer/Offer.

    modificationQueue: AsyncQueue
    numRemoteAudioSources: number
    numRemoteVideoSources: number
    options: IJingleSessionPCOptions
    pcConfig: object

    The {@code RTCConfiguration} object passed to the PeerConnection's constructor.

    peerconnection: TraceablePeerConnection
    remoteJid: string

    The JID of the remote peer.

    sid: string

    The Jingle session identifier.

    state: JingleSessionState

    Jingle session state - uninitialized until initialize is called

    usedrip: boolean

    Whether to use dripping or not. Dripping is sending trickle candidates not one-by-one.

    Accessors

    • get initiatorJid(): string

      Returns XMPP address of this session's initiator.

      Returns string

    • get responderJid(): string

      Returns XMPP address of this session's responder.

      Returns string

    Methods

    • Accepts incoming Jingle 'session-initiate' and should send 'session-accept' in result.

      Parameters

      • jingleOffer: object

        element pointing to the jingle element of the offer IQ

      • success: () => void

        callback called when we accept incoming session successfully and receive RESULT packet to 'session-accept' sent.

      • failure: (error: any) => void

        function(error) called if for any reason we fail to accept the incoming offer. 'error' argument can be used to log some details about the error.

      • OptionallocalTracks: JitsiLocalTrack[] = []

        the optional list of the local tracks that will be added, before the offer/answer cycle executes. We allow the localTracks to optionally be passed in so that the addition of the local tracks and the processing of the initial offer can all be done atomically. We want to make sure that any other operations which originate in the XMPP Jingle messages related with this session to be executed with an assumption that the initial offer/answer cycle has been executed already.

      Returns void

    • Adds new cancellable listener.

      Parameters

      • eventName: string

        the name of the event

      • listener: EventListener

        the listener.

      Returns () => void

      • The unsubscribe function.
    • Handles a Jingle source-add message for this Jingle session.

      Parameters

      • elem: Element[]

        an array of Jingle "content" elements.

      Returns void

      resolved when the operation is done or rejected with an error.

    • Handles an 'add-source' event.

      Parameters

      • contents: unknown

        an array of Jingle 'content' elements.

      Returns void

    • Adds a new track to the peerconnection. This method needs to be called only when a secondary JitsiLocalTrack is being added to the peerconnection for the first time.

      Parameters

      • localTracks: JitsiLocalTrack[] = null

        Tracks to be added to the peer connection.

      Returns Promise<void>

      that resolves when the track is successfully added to the peerconnection, rejected otherwise.

    • Adds local track back to the peerconnection associated with this session.

      Parameters

      • track: JitsiLocalTrack

        the local track to be added back to the peerconnection.

      Returns Promise<void>

      a promise that will resolve once the local track is added back to this session and renegotiation succeeds (if its warranted). Will be rejected with a string that provides some error details in case something goes wrong.

    • Parameters

      • options: IJingleSessionPCOptions

        a set of config options.

      Returns void

    • Emits an event.

      Parameters

      • event: string

        event name

      • ...args: any[]

      Returns void

    • Returns the ice connection state for the peer connection.

      Returns RTCIceConnectionState

      the ice connection state for the peer connection.

    • Returns the preference for max frame height for the remote video sources.

      Returns ISourceFrameHeight[]

    • Returns current state of this JingleSession instance.

      Returns JingleSessionState

      the current state of this session instance.

    • Prepares this object to initiate a session.

      Parameters

      • room: ChatRoom

        the chat room for the conference associated with this session

      • rtc: RTC

        the RTC service instance

      • signalingLayer: SignalingLayerImpl

        The signaling layer instance.

      • options: object

        the options, see implementing class's #doInitialize description for more details.

      Returns void

    • Creates an offer and sends Jingle 'session-initiate' to the remote peer.

      Parameters

      • localTracks: JitsiLocalTrack[] = []

        the local tracks that will be added, before the offer/answer cycle executes (for the local track addition to be an atomic operation together with the offer/answer).

      Returns Promise<void>

      that resolves when the offer is sent to the remote peer, rejected otherwise.

    • Returns the number of listeners for the specified event.

      Parameters

      • OptionaleventName: string

        The name of the event.

      Returns number

      • The number of listeners for the event.
    • Enables/disables local video based on 'senders' attribute of the video conent in 'content-modify' IQ sent by the remote peer. Also, checks if the sourceMaxFrameHeight (as requested by the p2p peer) or the senders attribute of the video content has changed and modifies the local video resolution accordingly.

      Parameters

      • jingleContents: IJingleContents

        The content of the 'content-modify' IQ sent by the remote peer.

      Returns void

    • Attaches a handler for events (e.g., "participant joined") in the conference. All possible events are defined in JitsiConferenceEvents.

      Parameters

      • eventId: string

        The event ID.

      • handler: EventListener

        Handler for the event.

      Returns void

    • Handles the termination of the session.

      Parameters

      • reasonCondition: string

        The XMPP Jingle reason condition.

      • reasonText: string

        The XMPP Jingle reason text.

      Returns void

    • Processes the source map message received from the bridge and creates a new remote track for newly signaled SSRCs or updates the source-name and owner on the remote track for an existing SSRC.

      Parameters

      • message: any

        The source map message.

      • mediaType: MediaType

        The media type, 'audio' or 'video'.

      Returns void

    • Removes all listeners for the event emitter.

      Returns void

    • Alias for off method.

      Parameters

      • eventId: string

        The event ID.

      • Optionalhandler: EventListener

        Optional, the specific handler to unbind.

      Returns void

    • Handles a Jingle source-remove message for this Jingle session.

      Parameters

      • elem: Element[]

      Returns void

    • Handles the deletion of SSRCs associated with a remote user from the remote description when the user leaves.

      Parameters

      • id: string

        Endpoint id of the participant that has left the call.

      Returns void

    • Handles a 'remove-source' event.

      Parameters

      • contents: unknown

        an array of Jingle 'content' elements.

      Returns void

    • Removes local track from the peerconnection as part of the mute operation.

      Parameters

      Returns Promise<void>

      a promise which will be resolved once the local track is removed from this session or rejected with a string that the describes the error if anything goes wrong.

    • Replaces oldTrack with newTrack and performs a single offer/answer cycle (if needed) after both operations are done. oldTrack or newTrack can be null; replacing a valid oldTrack with a null newTrack effectively just removes oldTrack.

      Parameters

      Returns Promise<void>

      which resolves once the replacement is complete with no arguments or rejects with an error.

    • Sets the answer received from the remote peer as the remote description.

      Parameters

      • jingleAnswer: Element

        The jingle answer element.

      Returns Promise<void>

      that resolves when the answer is set as the remote description, rejected otherwise.

    • Resumes or suspends media transfer over the underlying peer connection.

      Parameters

      • active: boolean

        true to enable media transfer or false to suspend media transmission.

      Returns Promise<void>

    • Resumes or suspends video media transfer over the p2p peer connection.

      Parameters

      • videoActive: boolean

        true to enable video media transfer or false to suspend video media transmission.

      Returns Promise<void>

      a Promise which will resolve once the operation is done. It will be rejected with an error description as a string in case anything goes wrong.

    • Adjust the preference for max video frame height that the local party is willing to receive. Signals the remote p2p peer.

      Parameters

      • sourceReceiverConstraints: Map<string, number>

        The receiver constraints per source.

      Returns void

    • Sets the resolution constraint on the local video tracks.

      Parameters

      • maxFrameHeight: number

        The user preferred max frame height.

      • sourceName: string = null

        The source name of the track.

      Returns Promise<void>

      promise that will be resolved when the operation is successful and rejected otherwise.

    • Parameters

      • success: () => void
      • failure: (error: IJingleError) => void
      • options: ITerminateOptions = {}

      Returns void

    • Parses the source-name and max frame height value of the 'content-modify' IQ when source-name signaling is enabled.

      Parameters

      • jingleContents: IJingleContents

        An element pointing to the '>jingle' element.

      Returns ISourceFrameHeight[]