Skip to content

Commit

Permalink
Revert "Include local iceParameters in Transport 'connect' event (#292)"
Browse files Browse the repository at this point in the history
This reverts commit c7ef994.
  • Loading branch information
ibc committed Feb 19, 2024
1 parent fd87c23 commit 78724f8
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 179 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/mediasoup-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
- os: ubuntu-22.04
node: 20
- os: macos-12
node: 18
- os: macos-14
node: 20
- os: windows-2022
node: 20
Expand Down
14 changes: 3 additions & 11 deletions src/Transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export type PlainRtpParameters = {

export type TransportEvents = {
connect: [
{ iceParameters: IceParameters; dtlsParameters: DtlsParameters },
{ dtlsParameters: DtlsParameters },
() => void,
(error: Error) => void,
];
Expand Down Expand Up @@ -1106,10 +1106,7 @@ export class Transport<
handler.on(
'@connect',
(
{
iceParameters,
dtlsParameters,
}: { iceParameters: IceParameters; dtlsParameters: DtlsParameters },
{ dtlsParameters }: { dtlsParameters: DtlsParameters },
callback: () => void,
errback: (error: Error) => void
) => {
Expand All @@ -1119,12 +1116,7 @@ export class Transport<
return;
}

this.safeEmit(
'connect',
{ iceParameters, dtlsParameters },
callback,
errback
);
this.safeEmit('connect', { dtlsParameters }, callback, errback);
}
);

Expand Down
12 changes: 1 addition & 11 deletions src/handlers/Chrome111.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1094,11 +1094,6 @@ export class Chrome111 extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -1114,12 +1109,7 @@ export class Chrome111 extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down
12 changes: 1 addition & 11 deletions src/handlers/Chrome55.ts
Original file line number Diff line number Diff line change
Expand Up @@ -822,11 +822,6 @@ export class Chrome55 extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -842,12 +837,7 @@ export class Chrome55 extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down
12 changes: 1 addition & 11 deletions src/handlers/Chrome67.ts
Original file line number Diff line number Diff line change
Expand Up @@ -924,11 +924,6 @@ export class Chrome67 extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -944,12 +939,7 @@ export class Chrome67 extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down
12 changes: 1 addition & 11 deletions src/handlers/Chrome70.ts
Original file line number Diff line number Diff line change
Expand Up @@ -977,11 +977,6 @@ export class Chrome70 extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -997,12 +992,7 @@ export class Chrome70 extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down
12 changes: 1 addition & 11 deletions src/handlers/Chrome74.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1117,11 +1117,6 @@ export class Chrome74 extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -1137,12 +1132,7 @@ export class Chrome74 extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down
10 changes: 1 addition & 9 deletions src/handlers/Edge11.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,22 +625,14 @@ export class Edge11 extends HandlerInterface {
}): Promise<void> {
logger.debug('setupTransport()');

// Get our local ICE parameters.
const iceParameters = this._iceGatherer.getLocalParameters();

// Get our local DTLS parameters.
const dtlsParameters = this._dtlsTransport.getLocalParameters();

dtlsParameters.role = localDtlsRole;

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

// Start the RTCIceTransport.
Expand Down
6 changes: 1 addition & 5 deletions src/handlers/FakeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,6 @@ export class FakeHandler extends HandlerInterface {
localDtlsRole: DtlsRole;
localSdpObject?: any;
}): Promise<void> {
const iceParameters = utils.clone<IceParameters>(
this.fakeParameters.generateLocalIceParameters()
);

const dtlsParameters = utils.clone<DtlsParameters>(
this.fakeParameters.generateLocalDtlsParameters()
);
Expand All @@ -471,7 +467,7 @@ export class FakeHandler extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) =>
this.emit('@connect', { iceParameters, dtlsParameters }, resolve, reject)
this.emit('@connect', { dtlsParameters }, resolve, reject)
);

this._transportReady = true;
Expand Down
12 changes: 1 addition & 11 deletions src/handlers/Firefox60.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1129,11 +1129,6 @@ export class Firefox60 extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -1149,12 +1144,7 @@ export class Firefox60 extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/HandlerInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export type HandlerReceiveDataChannelResult = {
export type HandlerEvents = {
'@close': [];
'@connect': [
{ iceParameters: IceParameters; dtlsParameters: DtlsParameters },
{ dtlsParameters: DtlsParameters },
() => void,
(error: Error) => void,
];
Expand Down
12 changes: 1 addition & 11 deletions src/handlers/ReactNative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,11 +843,6 @@ export class ReactNative extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -863,12 +858,7 @@ export class ReactNative extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down
12 changes: 1 addition & 11 deletions src/handlers/ReactNativeUnifiedPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1146,11 +1146,6 @@ export class ReactNativeUnifiedPlan extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -1166,12 +1161,7 @@ export class ReactNativeUnifiedPlan extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down
12 changes: 1 addition & 11 deletions src/handlers/Safari11.ts
Original file line number Diff line number Diff line change
Expand Up @@ -918,11 +918,6 @@ export class Safari11 extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -938,12 +933,7 @@ export class Safari11 extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down
12 changes: 1 addition & 11 deletions src/handlers/Safari12.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,11 +1084,6 @@ export class Safari12 extends HandlerInterface {
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
}

// Get our local ICE parameters.
const iceParameters = sdpCommonUtils.extractIceParameters({
sdpObject: localSdpObject,
});

// Get our local DTLS parameters.
const dtlsParameters = sdpCommonUtils.extractDtlsParameters({
sdpObject: localSdpObject,
Expand All @@ -1104,12 +1099,7 @@ export class Safari12 extends HandlerInterface {

// Need to tell the remote transport about our parameters.
await new Promise<void>((resolve, reject) => {
this.safeEmit(
'@connect',
{ iceParameters, dtlsParameters },
resolve,
reject
);
this.safeEmit('@connect', { dtlsParameters }, resolve, reject);
});

this._transportReady = true;
Expand Down

0 comments on commit 78724f8

Please sign in to comment.