/**
* Creates new instance of 'TraceablePeerConnection'.
*
* @param {RTC} rtc the instance of RTC service
* @param {number} id the peer connection id assigned by the parent RTC module.
* @param {SignalingLayer} signalingLayer the signaling layer instance
* @param {object} pcConfig The {@code RTCConfiguration} to use for the WebRTC peer connection.
* @param {object} constraints WebRTC 'PeerConnection' constraints
* @param {boolean} isP2P indicates whether or not the new instance will be used in a peer to peer connection.
* @param {object} options TracablePeerConnection config options.
* @param {boolean} options.disableSimulcast if set to 'true' will disable the simulcast.
* @param {boolean} options.disableRtx if set to 'true' will disable the RTX.
* @param {string} options.disabledCodec the mime type of the code that should not be negotiated on the peerconnection.
* @param {string} options.preferredCodec the mime type of the codec that needs to be made the preferred codec for the
* peerconnection.
* @param {boolean} options.startSilent If set to 'true' no audio will be sent or received.
* @param {boolean} options.usesUnifiedPlan Indicates if the browser is running in unified plan mode.
*
* 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.
*
* @constructor
*/
export default function TraceablePeerConnection(rtc: RTC, id: number, signalingLayer: any, pcConfig: object, constraints: object, isP2P: boolean, options: {
disableSimulcast: boolean;
disableRtx: boolean;
disabledCodec: string;
preferredCodec: string;
startSilent: boolean;
usesUnifiedPlan: boolean;
}): void;
export default class TraceablePeerConnection {
/**
* Creates new instance of 'TraceablePeerConnection'.
*
* @param {RTC} rtc the instance of RTC service
* @param {number} id the peer connection id assigned by the parent RTC module.
* @param {SignalingLayer} signalingLayer the signaling layer instance
* @param {object} pcConfig The {@code RTCConfiguration} to use for the WebRTC peer connection.
* @param {object} constraints WebRTC 'PeerConnection' constraints
* @param {boolean} isP2P indicates whether or not the new instance will be used in a peer to peer connection.
* @param {object} options TracablePeerConnection config options.
* @param {boolean} options.disableSimulcast if set to 'true' will disable the simulcast.
* @param {boolean} options.disableRtx if set to 'true' will disable the RTX.
* @param {string} options.disabledCodec the mime type of the code that should not be negotiated on the peerconnection.
* @param {string} options.preferredCodec the mime type of the codec that needs to be made the preferred codec for the
* peerconnection.
* @param {boolean} options.startSilent If set to 'true' no audio will be sent or received.
* @param {boolean} options.usesUnifiedPlan Indicates if the browser is running in unified plan mode.
*
* 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.
*
* @constructor
*/
constructor(rtc: RTC, id: number, signalingLayer: any, pcConfig: object, constraints: object, isP2P: boolean, options: {
disableSimulcast: boolean;
disableRtx: boolean;
disabledCodec: string;
preferredCodec: string;
startSilent: boolean;
usesUnifiedPlan: boolean;
});
/**
* Indicates whether or not this peer connection instance is actively
* sending/receiving audio media. When set to false the SDP audio
* media direction will be adjusted to 'inactive' in order to suspend
* the transmission.
* @type {boolean}
* @private
*/
private audioTransferActive;
/**
* The DTMF sender instance used to send DTMF tones.
*
* @type {RTCDTMFSender|undefined}
* @private
*/
private _dtmfSender;
/**
* @typedef {Object} TouchToneRequest
* @property {string} tones - The DTMF tones string as defined by
* {@code RTCDTMFSender.insertDTMF}, 'tones' argument.
* @property {number} duration - The amount of time in milliseconds that
* each DTMF should last.
* @property {string} interToneGap - The length of time in miliseconds to
* wait between tones.
*/
/**
* TouchToneRequests which are waiting to be played. This queue is filled
* if there are touch tones currently being played.
*
* @type {Array}
* @private
*/
private _dtmfTonesQueue;
/**
* Indicates whether or not this peer connection instance is actively
* sending/receiving video media. When set to false the SDP video
* media direction will be adjusted to 'inactive' in order to suspend
* the transmission.
* @type {boolean}
* @private
*/
private videoTransferActive;
/**
* The parent instance of RTC service which created this
* TracablePeerConnection.
* @type {RTC}
*/
rtc: RTC;
/**
* The peer connection identifier assigned by the RTC module.
* @type {number}
*/
id: number;
/**
* Indicates whether or not this instance is used in a peer to peer
* connection.
* @type {boolean}
*/
isP2P: boolean;
/**
* The map holds remote tracks associated with this peer connection. It maps user's JID to media type and a set of
* remote tracks.
* @type {Map>>}
*/
remoteTracks: Map>>;
/**
* A map which stores local tracks mapped by {@link JitsiLocalTrack.rtcId}
* @type {Map}
*/
localTracks: Map;
/**
* Keeps tracks of the WebRTC MediaStreams that have been added to
* the underlying WebRTC PeerConnection.
* @type {Array}
* @private
*/
private _addedStreams;
/**
* @typedef {Object} TPCGroupInfo
* @property {string} semantics the SSRC groups semantics
* @property {Array} ssrcs group's SSRCs in order where the first
* one is group's primary SSRC, the second one is secondary (RTX) and so
* on...
*/
/**
* @typedef {Object} TPCSSRCInfo
* @property {Array} ssrcs an array which holds all track's SSRCs
* @property {Array} groups an array stores all track's SSRC
* groups
*/
/**
* Holds the info about local track's SSRCs mapped per their
* {@link JitsiLocalTrack.rtcId}
* @type {Map}
*/
localSSRCs: Map;
/**
* an array stores all track's SSRC
* groups
*/
groups: {
/**
* the SSRC groups semantics
*/
semantics: string;
/**
* group's SSRCs in order where the first
* one is group's primary SSRC, the second one is secondary (RTX) and so
* on...
*/
ssrcs: Array;
}[];
}>;
/**
* The set of remote SSRCs seen so far.
* Distinguishes new SSRCs from those that have been remapped.
* @type {Set}
*/
remoteSSRCs: Set;
/**
* Mapping of source-names and their associated SSRCs that have been signaled by the JVB.
* @type {Map}
*/
remoteSources: Map;
/**
* The local ICE username fragment for this session.
*/
localUfrag: any;
/**
* The remote ICE username fragment for this session.
*/
remoteUfrag: any;
/**
* The DTLS transport object for the PeerConnection.
* Note: this assume only one shared transport exists because we bundled
* all streams on the same underlying transport.
*/
_dtlsTransport: RTCDtlsTransport;
/**
* The signaling layer which operates this peer connection.
* @type {SignalingLayer}
*/
signalingLayer: any;
_peerVideoTypeChanged: any;
_peerMutedChanged: any;
options: {
disableSimulcast: boolean;
disableRtx: boolean;
disabledCodec: string;
preferredCodec: string;
startSilent: boolean;
usesUnifiedPlan: boolean;
};
peerconnection: RTCPeerConnection;
tpcUtils: TPCUtils;
updateLog: any[];
stats: {};
statsinterval: number;
/**
* Flag used to indicate if low fps screenshare is desired.
*/
_capScreenshareBitrate: any;
/**
* Flag used to indicate if the browser is running in unified plan mode.
*/
_usesUnifiedPlan: boolean;
/**
* Codec preferences set for the peerconnection through config.js.
*/
codecSettings: any;
/**
* Flag used to indicate if RTCRtpTransceiver#setCodecPreferences is to be used instead of SDP
* munging for codec selection.
*/
_usesTransceiverCodecPreferences: boolean;
/**
* Indicates whether an audio track has ever been added to the peer connection.
*/
_hasHadAudioTrack: boolean;
/**
* Indicates whether a video track has ever been added to the peer connection.
*/
_hasHadVideoTrack: boolean;
/**
* @type {number} The max number of stats to keep in this.stats. Limit to
* 300 values, i.e. 5 minutes; set to 0 to disable
*/
maxstats: number;
interop: any;
simulcast: any;
sdpConsistency: SdpConsistency;
/**
* Munges local SDP provided to the Jingle Session in order to prevent from
* sending SSRC updates on attach/detach and mute/unmute (for video).
* @type {LocalSdpMunger}
*/
localSdpMunger: LocalSdpMunger;
/**
* TracablePeerConnection uses RTC's eventEmitter
* @type {EventEmitter}
*/
eventEmitter: any;
rtxModifier: RtxModifier;
/**
* The height constraint applied on the video sender. The default value is 2160 (4K) when layer suspension is
* explicitly disabled.
*/
_senderVideoMaxHeight: number;
/**
* The height constraints to be applied on the sender per local video source (source name as the key).
* @type {Map}
*/
_senderMaxHeights: Map;
/**
* Holds the RTCRtpTransceiver mids that the local tracks are attached to, mapped per their
* {@link JitsiLocalTrack.rtcId}.
* @type {Map}
*/
_localTrackTransceiverMids: Map;
trace: (what: any, info: any) => void;
onicecandidate: any;
onTrack: (evt: any) => void;
onsignalingstatechange: any;
oniceconnectionstatechange: any;
onnegotiationneeded: any;
onconnectionstatechange: any;
ondatachannel: any;
_lastVideoSenderUpdatePromise: Promise;
private _processStat;
/**
* Forwards the {@link 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.
* @return {string}
*/
getConnectionState(): string;
private getDesiredMediaDirection;
/**
* Returns the MID of the m-line associated with the local desktop track (if it exists).
*
* @returns {Number|null}
*/
_getDesktopTrackMid(): number | null;
/**
* Returns the list of RTCRtpReceivers created for the source of the given media type associated with
* the set of remote endpoints specified.
* @param {Array} endpoints list of the endpoints
* @param {string} mediaType 'audio' or 'video'
* @returns {Array} list of receivers created by the peerconnection.
*/
_getReceiversByEndpointIds(endpoints: Array, mediaType: string): Array;
/**
* Tells whether or not this TPC instance is using Simulcast.
* @return {boolean} true if simulcast is enabled and active or
* false if it's turned off.
*/
isSimulcastOn(): boolean;
/**
* Handles remote source mute and unmute changed events.
*
* @param {string} sourceName - The name of the remote source.
* @param {boolean} isMuted - The new mute state.
*/
_sourceMutedChanged(sourceName: string, isMuted: boolean): void;
/**
* Handles remote source videoType changed events.
*
* @param {string} sourceName - The name of the remote source.
* @param {boolean} isMuted - The new value.
*/
_sourceVideoTypeChanged(sourceName: string, videoType: any): void;
/**
* 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.
* @param {Array} speakerList list of endpoint ids for which audio levels are to be gathered.
* @returns {Object} containing ssrc and audio level information as a key-value pair.
*/
getAudioLevels(speakerList?: Array): any;
/**
* Checks if the browser is currently doing true simulcast where in three different media streams are being sent to the
* bridge. Currently this happens only when VP8 is the selected codec.
* @returns {boolean}
*/
doesTrueSimulcast(): boolean;
/**
* Returns the SSRCs associated with a given local video track.
*
* @param {JitsiLocalTrack} localTrack
* @returns
*/
getLocalVideoSSRCs(localTrack: any): any[];
/**
* Obtains local tracks for given {@link MediaType}. If the mediaType
* argument is omitted the list of all local tracks will be returned.
* @param {MediaType} [mediaType]
* @return {Array}
*/
getLocalTracks(mediaType?: MediaType): Array;
/**
* Retrieves the local video tracks.
*
* @returns {Array} - local video tracks.
*/
getLocalVideoTracks(): Array;
/**
* Checks whether or not this {@link TraceablePeerConnection} instance contains any local tracks for given
* mediaType.
*
* @param {MediaType} mediaType - The media type.
* @return {boolean}
*/
hasAnyTracksOfType(mediaType: MediaType): boolean;
/**
* Obtains all remote tracks currently known to this PeerConnection instance.
*
* @param {string} [endpointId] - The track owner's identifier (MUC nickname)
* @param {MediaType} [mediaType] - The remote tracks will be filtered by their media type if this argument is
* specified.
* @return {Array}
*/
getRemoteTracks(endpointId?: string, mediaType?: MediaType): Array;
/**
* Parses the remote description and returns the sdp lines of the sources associated with a remote participant.
*
* @param {string} id Endpoint id of the remote participant.
* @returns {Array} The sdp lines that have the ssrc information.
*/
getRemoteSourceInfoByParticipant(id: string): Array;
/**
* Returns the target bitrates configured for the local video source.
*
* @returns {Object}
*/
getTargetVideoBitrates(): any;
/**
* Tries to find {@link JitsiTrack} for given SSRC number. It will search both
* local and remote tracks bound to this instance.
* @param {number} ssrc
* @return {JitsiTrack|null}
*/
getTrackBySSRC(ssrc: number): any | null;
/**
* Tries to find SSRC number for given {@link JitsiTrack} id. It will search
* both local and remote tracks bound to this instance.
* @param {string} id
* @return {number|null}
*/
getSsrcByTrackId(id: string): number | null;
/**
* Called when new remote MediaStream is added to the PeerConnection.
* @param {MediaStream} stream the WebRTC MediaStream for remote participant
*/
_remoteStreamAdded(stream: MediaStream): 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.
* @param {MediaStream} stream the WebRTC MediaStream instance which is
* the parent of the track
* @param {MediaStreamTrack} track the WebRTC MediaStreamTrack added for remote
* participant.
* @param {RTCRtpTransceiver} transceiver the WebRTC transceiver that is created
* for the remote participant in unified plan.
*/
_remoteTrackAdded(stream: MediaStream, track: MediaStreamTrack, transceiver?: RTCRtpTransceiver): void;
/**
* Initializes a new JitsiRemoteTrack instance with the data provided by
* the signaling layer and SDP.
*
* @param {string} ownerEndpointId the owner's endpoint ID (MUC nickname)
* @param {MediaStream} stream the WebRTC stream instance
* @param {MediaStreamTrack} track the WebRTC track instance
* @param {MediaType} mediaType the track's type of the media
* @param {VideoType} [videoType] the track's type of the video (if applicable)
* @param {number} ssrc the track's main SSRC number
* @param {boolean} muted the initial muted status
* @param {String} sourceName the track's source name
*/
_createRemoteTrack(ownerEndpointId: string, stream: MediaStream, track: MediaStreamTrack, mediaType: MediaType, videoType?: VideoType, ssrc: number, muted: boolean, sourceName: string): void;
/**
* Handles remote stream removal.
* @param stream the WebRTC MediaStream object which is being removed from the
* PeerConnection
*/
_remoteStreamRemoved(stream: any): void;
/**
* Handles remote media track removal.
*
* @param {MediaStream} stream - WebRTC MediaStream instance which is the parent of the track.
* @param {MediaStreamTrack} track - WebRTC MediaStreamTrack which has been removed from the PeerConnection.
* @returns {void}
*/
_remoteTrackRemoved(stream: MediaStream, track: MediaStreamTrack): void;
/**
* Removes all JitsiRemoteTracks associated with given MUC nickname (resource part of the JID).
*
* @param {string} owner - The resource part of the MUC JID.
* @returns {JitsiRemoteTrack[]} - The array of removed tracks.
*/
removeRemoteTracks(owner: string): JitsiRemoteTrack[];
/**
* Removes and disposes given JitsiRemoteTrack instance. Emits {@link RTCEvents.REMOTE_TRACK_REMOVED}.
*
* @param {JitsiRemoteTrack} toBeRemoved - The remote track to be removed.
* @returns {void}
*/
_removeRemoteTrack(toBeRemoved: JitsiRemoteTrack): void;
/**
* Returns a map with keys msid/mediaType and TrackSSRCInfo values.
* @param {RTCSessionDescription} desc the local description.
* @return {Map}
*/
_extractSSRCMap(desc: RTCSessionDescription): Map;
/**
*
* @param {JitsiLocalTrack} localTrack
*/
getLocalSSRC(localTrack: any): number;
/**
* When doing unified plan simulcast, we'll have a set of ssrcs but no ssrc-groups on Firefox. Unfortunately, Jicofo
* will complain if it sees ssrcs with matching msids but no ssrc-group, so a ssrc-group line is injected to make
* Jicofo happy.
*
* @param desc A session description object (with 'type' and 'sdp' fields)
* @return A session description object with its sdp field modified to contain an inject ssrc-group for simulcast.
*/
_injectSsrcGroupForUnifiedSimulcast(desc: any): any;
_getSSRC(rtcId: any): {
/**
* an array which holds all track's SSRCs
*/
ssrcs: Array;
/**
* an array stores all track's SSRC
* groups
*/
groups: {
/**
* the SSRC groups semantics
*/
semantics: string;
/**
* group's SSRCs in order where the first
* one is group's primary SSRC, the second one is secondary (RTX) and so
* on...
*/
ssrcs: Array;
}[];
};
private isSharingLowFpsScreen;
/**
* Checks if screensharing is in progress.
*
* @returns {boolean} Returns true if a desktop track has been added to the peerconnection, false otherwise.
*/
_isSharingScreen(): boolean;
/**
* Munges the order of the codecs in the SDP passed based on the preference
* set through config.js settings. All instances of the specified codec are
* moved up to the top of the list when it is preferred. The specified codec
* is deleted from the list if the configuration specifies that the codec be
* disabled.
* @param {RTCSessionDescription} description that needs to be munged.
* @returns {RTCSessionDescription} the munged description.
*/
_mungeCodecOrder(description: RTCSessionDescription): RTCSessionDescription;
/**
* Add {@link JitsiLocalTrack} to this TPC.
* @param {JitsiLocalTrack} track
* @param {boolean} isInitiator indicates if the endpoint is the offerer.
* @returns {Promise} - resolved when done.
*/
addTrack(track: any, isInitiator?: boolean): Promise;
/**
* Adds local track to the RTCPeerConnection.
*
* @param {JitsiLocalTrack} track the track to be added to the pc.
* @return {Promise} 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.
*/
addTrackToPc(track: any): Promise;
private _addStream;
/**
* Removes WebRTC media stream from the underlying PeerConection
* @param {MediaStream} mediaStream
*/
_removeStream(mediaStream: MediaStream): void;
private _assertTrackBelongs;
/**
* Returns the codec that is configured on the client as the preferred video codec.
* This takes into account the current order of codecs in the local description sdp.
*
* @returns {CodecMimeType} The codec that is set as the preferred codec to receive
* video in the local SDP.
*/
getConfiguredVideoCodec(): {
AV1: string;
H264: string;
OPUS: string;
ULPFEC: string;
VP8: string;
VP9: string;
};
/**
* Returns the codecs in the current order of preference as configured on the peerconnection.
*
* @returns {Array}
*/
getConfiguredVideoCodecs(): any[];
/**
* Checks if the client has negotiated not to receive video encoded using the given codec, i.e., the codec has been
* removed from the local description.
*/
isVideoCodecDisabled(codec: any): boolean;
/**
* Enables or disables simulcast for screenshare based on the frame rate requested for desktop track capture.
*
* @param {number} maxFps framerate to be used for desktop track capture.
*/
setDesktopSharingFrameRate(maxFps: number): void;
/**
* Sets the codec preference on the peerconnection. The codec preference goes into effect when
* the next renegotiation happens.
*
* @param {CodecMimeType} preferredCodec the preferred codec.
* @param {CodecMimeType} disabledCodec the codec that needs to be disabled.
* @returns {void}
*/
setVideoCodecs(codecList: any): void;
/**
* Tells if the given WebRTC MediaStream has been added to
* the underlying WebRTC PeerConnection.
* @param {MediaStream} mediaStream
* @returns {boolean}
*/
isMediaStreamInPc(mediaStream: MediaStream): boolean;
/**
* Remove local track from this TPC.
* @param {JitsiLocalTrack} localTrack the track to be removed from this TPC.
*
* FIXME It should probably remove a boolean just like {@link removeTrackFromPc}
* The same applies to addTrack.
*/
removeTrack(localTrack: any): void;
/**
* Returns the sender corresponding to the given media type.
* @param {MEDIA_TYPE} mediaType - The media type 'audio' or 'video' to be used for the search.
* @returns {RTPSender|undefined} - The found sender or undefined if no sender
* was found.
*/
findSenderByKind(mediaType: any): any | undefined;
/**
* Returns the receiver corresponding to the given MediaStreamTrack.
*
* @param {MediaSreamTrack} track - The media stream track used for the search.
* @returns {RTCRtpReceiver|undefined} - The found receiver or undefined if no receiver
* was found.
*/
findReceiverForTrack(track: any): RTCRtpReceiver | undefined;
/**
* Returns the sender corresponding to the given MediaStreamTrack.
*
* @param {MediaSreamTrack} track - The media stream track used for the search.
* @returns {RTCRtpSender|undefined} - The found sender or undefined if no sender
* was found.
*/
findSenderForTrack(track: any): RTCRtpSender | undefined;
/**
* Processes the local description SDP and caches the mids of the mlines associated with the given tracks.
*
* @param {Array} localTracks - local tracks that are added to the peerconnection.
* @returns {void}
*/
processLocalSdpForTransceiverInfo(localTracks: Array): void;
/**
* 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
*
* @param {JitsiLocalTrack|null} oldTrack - The current track in use to be replaced on the pc.
* @param {JitsiLocalTrack|null} newTrack - The new track to be used.
*
* @returns {Promise} - If the promise resolves with true, renegotiation will be needed.
* Otherwise no renegotiation is needed.
*/
replaceTrack(oldTrack: any | null, newTrack: any | null): Promise;
/**
* Removes local track from the RTCPeerConnection.
*
* @param {JitsiLocalTrack} localTrack the local track to be removed.
* @return {Promise} 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.
*/
removeTrackFromPc(localTrack: any): Promise;
createDataChannel(label: any, opts: any): RTCDataChannel;
private _ensureSimulcastGroupIsLast;
private _adjustLocalMediaDirection;
private _adjustRemoteMediaDirection;
/**
* Munges the stereo flag as well as the opusMaxAverageBitrate in the SDP, based
* on values set through config.js, if present.
*
* @param {RTCSessionDescription} description that needs to be munged.
* @returns {RTCSessionDescription} the munged description.
*/
_mungeOpus(description: RTCSessionDescription): RTCSessionDescription;
/**
* Munges the SDP to set all directions to inactive and drop all ssrc and ssrc-groups.
*
* @param {RTCSessionDescription} description that needs to be munged.
* @returns {RTCSessionDescription} the munged description.
*/
_mungeInactive(description: RTCSessionDescription): RTCSessionDescription;
/**
* Sets up the _dtlsTransport object and initializes callbacks for it.
*/
_initializeDtlsTransport(): void;
/**
* Sets the max bitrates on the video m-lines when VP9 is the selected codec.
*
* @param {RTCSessionDescription} description - The local description that needs to be munged.
* @param {boolean} isLocalSdp - Whether the max bitrate (via b=AS line in SDP) is set on local SDP.
* @returns RTCSessionDescription
*/
_setVp9MaxBitrates(description: RTCSessionDescription, isLocalSdp?: boolean): RTCSessionDescription;
/**
* Configures the stream encodings depending on the video type and the bitrates configured.
*
* @param {JitsiLocalTrack} - The local track for which the sender encodings have to configured.
* @returns {Promise} promise that will be resolved when the operation is successful and rejected otherwise.
*/
configureSenderVideoEncodings(localVideoTrack?: any): Promise;
setLocalDescription(description: any): Promise;
setRemoteDescription(description: any): Promise;
/**
* 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.
*
* @param {number} frameHeight - The max frame height to be imposed on the outgoing video stream.
* @param {JitsiLocalTrack} - The local track for which the sender constraints have to be applied.
* @returns {Promise} promise that will be resolved when the operation is successful and rejected otherwise.
*/
setSenderVideoConstraints(frameHeight: number, localVideoTrack: any): Promise;
/**
* Returns a wrapped-up promise so that the setParameters() call on the RTCRtpSender for video sources are chained.
* This is needed on Chrome as it resets the transaction id after executing setParameters() and can affect the next on
* the fly updates if they are not chained.
* https://chromium.googlesource.com/external/webrtc/+/master/pc/rtp_sender.cc#340
* @param {Promise} promise - The promise that needs to be chained.
* @returns {Promise}
*/
_updateVideoSenderParameters(promise: Promise): Promise;
/**
* Configures the video stream with resolution / degradation / maximum bitrates
*
* @param {number} frameHeight - The max frame height to be imposed on the outgoing video stream.
* @param {JitsiLocalTrack} - The local track for which the sender constraints have to be applied.
* @returns {Promise} promise that will be resolved when the operation is successful and rejected otherwise.
*/
_updateVideoSenderEncodings(frameHeight: number, localVideoTrack: any): Promise;
encodingsEnabledState: boolean[];
/**
* Enables/disables video media transmission on this peer connection. When
* disabled the SDP video media direction in the local SDP will be adjusted to
* 'inactive' which means that no data will be sent nor accepted, but
* the connection should be kept alive.
* @param {boolean} active true to enable video media transmission or
* false to disable. If the value is not a boolean the call will have
* no effect.
* @return {boolean} true if the value has changed and sRD/sLD cycle
* needs to be executed in order for the changes to take effect or
* false if the given value was the same as the previous one.
* @public
*/
public setVideoTransferActive(active: boolean): boolean;
/**
* Sends DTMF tones if possible.
*
* @param {string} tones - The DTMF tones string as defined by {@code RTCDTMFSender.insertDTMF}, 'tones' argument.
* @param {number} duration - The amount of time in milliseconds that each DTMF should last. It's 200ms by default.
* @param {number} interToneGap - The length of time in miliseconds to wait between tones. It's 200ms by default.
*
* @returns {void}
*/
sendTones(tones: string, duration?: number, interToneGap?: number): void;
private _onToneChange;
/**
* Makes the underlying TraceablePeerConnection generate new SSRC for
* the recvonly video stream.
*/
generateRecvonlySsrc(): void;
/**
* Makes the underlying TraceablePeerConnection forget the current primary video
* SSRC.
*/
clearRecvonlySsrc(): void;
/**
* Closes underlying WebRTC PeerConnection instance and removes all remote
* tracks by emitting {@link RTCEvents.REMOTE_TRACK_REMOVED} for each one of
* them.
*/
close(): void;
createAnswer(constraints: any): Promise;
createOffer(constraints: any): Promise;
_createOfferOrAnswer(isOffer: any, constraints: any): Promise;
/**
* Extract primary SSRC from given {@link TrackSSRCInfo} object.
* @param {TrackSSRCInfo} ssrcObj
* @return {number|null} the primary SSRC or null
*/
_extractPrimarySSRC(ssrcObj: any): number | null;
private _processLocalSSRCsMap;
/**
* Track the SSRCs seen so far.
* @param {number} ssrc - SSRC.
* @return {boolean} - Whether this is a new SSRC.
*/
addRemoteSsrc(ssrc: number): boolean;
addIceCandidate(candidate: any): Promise;
/**
* Returns the number of simulcast streams that are currently enabled on the peerconnection.
*
* @returns {number} The number of simulcast streams currently enabled or 1 when simulcast is disabled.
*/
getActiveSimulcastStreams(): number;
/**
* Obtains call-related stats from the peer connection.
*
* @returns {Promise