Skip to content

Commit 3d3a788

Browse files
committed
RTC
1 parent fd975ce commit 3d3a788

File tree

4 files changed

+14
-26
lines changed

4 files changed

+14
-26
lines changed

JitsiMediaDevices.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default class JitsiMediaDevices extends Listenable {
9595
// We would still want to update the permissions cache in case the permissions API is not supported.
9696
RTC.addListener(
9797
RTCEvents.PERMISSIONS_CHANGED,
98-
// @ts-ignore
98+
// @ts-expect-error: The type of 'permissions' from RTCEvents.PERMISSIONS_CHANGED may not match the expected type for _handlePermissionsChange, but this is intentional due to legacy event payloads.
9999
permissions => this._handlePermissionsChange(permissions));
100100

101101
// Test if the W3C Permissions API is implemented and the 'camera' and 'microphone' permissions are

modules/RTC/RTC.ts

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import JitsiConference, { IConferenceOptions } from '../../JitsiConference';
55
import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
66
import { BridgeVideoType } from '../../service/RTC/BridgeVideoType';
77
import { CameraFacingMode } from '../../service/RTC/CameraFacingMode';
8-
import { CodecMimeType } from '../../service/RTC/CodecMimeType';
98
import { MediaType } from '../../service/RTC/MediaType';
109
import RTCEvents from '../../service/RTC/RTCEvents';
1110
import SignalingLayer, { SourceName } from '../../service/RTC/SignalingLayer';
@@ -19,7 +18,7 @@ import BridgeChannel from './BridgeChannel';
1918
import JitsiLocalTrack, { IStreamEffect, ITrackConstraints } from './JitsiLocalTrack';
2019
import JitsiRemoteTrack from './JitsiRemoteTrack';
2120
import RTCUtils from './RTCUtils';
22-
import TraceablePeerConnection from './TraceablePeerConnection';
21+
import TraceablePeerConnection, { ITPCOptions } from './TraceablePeerConnection';
2322

2423
// Extend RTCConfiguration to include the encodedInsertableStreams property
2524
interface IExtendedRTCConfiguration extends RTCConfiguration {
@@ -131,20 +130,6 @@ export interface IRTCOptions {
131130
};
132131
}
133132

134-
/**
135-
* Interface for createPeerConnection options
136-
*/
137-
export interface ICreatePeerConnectionOptions {
138-
audioQuality: object;
139-
capScreenshareBitrate: boolean;
140-
codecSettings: CodecMimeType[];
141-
disableRtx: boolean;
142-
disableSimulcast: boolean;
143-
enableInsertableStreams: boolean;
144-
forceTurnRelay: boolean;
145-
startSilent: boolean;
146-
videoQuality: object;
147-
}
148133
/**
149134
*
150135
*/
@@ -276,7 +261,7 @@ export default class RTC extends Listenable {
276261
enteringForwardedSources = forwardedSources.filter(
277262
sourceName => oldForwardedSources.indexOf(sourceName) === -1);
278263

279-
logger.debug(`Fowarded sources changed leaving=${leavingForwardedSources}, entering=`
264+
logger.debug(`Forwarded sources changed leaving=${leavingForwardedSources}, entering=`
280265
+ `${enteringForwardedSources} at ${timestamp}`);
281266
this.conference.eventEmitter.emit(
282267
JitsiConferenceEvents.FORWARDED_SOURCES_CHANGED,
@@ -293,8 +278,9 @@ export default class RTC extends Listenable {
293278
* @return {boolean} <tt>true</tt> if the given peer connection was removed
294279
* successfully or <tt>false</tt> if there was no peer connection mapped in
295280
* this RTC instance.
281+
* @internal
296282
*/
297-
private _removePeerConnection(traceablePeerConnection: TraceablePeerConnection): boolean {
283+
_removePeerConnection(traceablePeerConnection: TraceablePeerConnection): boolean {
298284
const id = traceablePeerConnection.id;
299285

300286
if (this.peerConnections.has(id)) {
@@ -460,7 +446,7 @@ export default class RTC extends Listenable {
460446

461447
this._receiverVideoConstraints = cloneDeep(constraints);
462448

463-
if (this?._channel.isOpen()) {
449+
if (this._channel?.isOpen()) {
464450
this._channel.sendReceiverVideoConstraintsMessage(constraints);
465451
}
466452
}
@@ -471,7 +457,7 @@ export default class RTC extends Listenable {
471457
* @param {BridgeVideoType} videoType - the track's video type.
472458
*/
473459
public sendSourceVideoType(sourceName: SourceName, videoType: BridgeVideoType): void {
474-
if (this?._channel.isOpen()) {
460+
if (this._channel?.isOpen()) {
475461
this._channel.sendSourceVideoTypeMessage(sourceName, videoType);
476462
}
477463
}
@@ -497,7 +483,7 @@ export default class RTC extends Listenable {
497483
* @param {Object} options.videoQuality - Quality settings to applied on the outbound video streams.
498484
* @return {TraceablePeerConnection}
499485
*/
500-
public createPeerConnection(signaling: SignalingLayer, pcConfig: IExtendedRTCConfiguration, isP2P: boolean, options: ICreatePeerConnectionOptions): TraceablePeerConnection {
486+
public createPeerConnection(signaling: SignalingLayer, pcConfig: IExtendedRTCConfiguration, isP2P: boolean, options: ITPCOptions): TraceablePeerConnection {
501487
const pcConstraints = {};
502488

503489
if (options.enableInsertableStreams) {
@@ -832,7 +818,7 @@ export default class RTC extends Listenable {
832818
* @throws NetworkError/InvalidStateError/Error if the operation fails or if there is no data channel created.
833819
*/
834820
public sendEndpointStatsMessage(payload: any): void {
835-
if (this?._channel.isOpen()) {
821+
if (this._channel?.isOpen()) {
836822
this._channel.sendEndpointStatsMessage(payload);
837823
}
838824
}
@@ -842,7 +828,7 @@ export default class RTC extends Listenable {
842828
* @param {*} message
843829
*/
844830
public sendReceiverAudioSubscriptionMessage(message: any): void {
845-
if (this?._channel.isOpen()) {
831+
if (this._channel?.isOpen()) {
846832
this._channel.sendReceiverAudioSubscriptionMessage(message);
847833
}
848834
}
@@ -856,7 +842,7 @@ export default class RTC extends Listenable {
856842
public setLastN(value: number): void {
857843
if (this._lastN !== value) {
858844
this._lastN = value;
859-
if (this?._channel.isOpen()) {
845+
if (this._channel?.isOpen()) {
860846
this._channel.sendSetLastNMessage(value);
861847
}
862848
this.eventEmitter.emit(RTCEvents.LASTN_VALUE_CHANGED, value);

modules/RTC/TraceablePeerConnection.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ export interface ITPCOptions {
8787
codecSettings: ICodecSettings;
8888
disableRtx: boolean;
8989
disableSimulcast: boolean;
90+
enableInsertableStreams?: boolean;
91+
forceTurnRelay?: boolean;
9092
maxstats: number;
9193
startSilent: boolean;
9294
usesCodecSelectionAPI: boolean;

modules/xmpp/JingleSessionPC.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ export default class JingleSessionPC extends JingleSession {
15861586
const pcOptions = {
15871587
audioQuality: options.audioQuality,
15881588
capScreenshareBitrate: undefined,
1589-
codecSettings: options.codecSettings,
1589+
codecSettings: options.codecSettings ? { codecList: options.codecSettings } : undefined,
15901590
disableRtx: options.disableRtx,
15911591
disableSimulcast: this.isP2P ? true : options.disableSimulcast,
15921592
enableInsertableStreams: options.enableInsertableStreams,

0 commit comments

Comments
 (0)