Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Nov 13, 2023
1 parent 5e455bf commit 757ad86
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/room/RTCEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ enum PCState {

/** @internal */
export default class RTCEngine extends (EventEmitter as new () => TypedEventEmitter<EngineEventCallbacks>) {
// publisher?: PCTransport;

// subscriber?: PCTransport;

client: SignalClient;

rtcConfig: RTCConfiguration = {};
Expand Down Expand Up @@ -110,8 +106,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit

private subscriberPrimary: boolean = false;

// private primaryTransport?: PCTransport;

private pcState: PCState = PCState.New;

private _isClosed: boolean = true;
Expand Down Expand Up @@ -248,8 +242,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
await this.pcManager?.close();
this.pcManager = undefined;

// this.primaryTransport = undefined;

const dcCleanup = (dc: RTCDataChannel | undefined) => {
if (!dc) return;
dc.close();
Expand Down Expand Up @@ -457,12 +449,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit

private makeRTCConfiguration(serverResponse: JoinResponse | ReconnectResponse): RTCConfiguration {
const rtcConfig = { ...this.rtcConfig };
if (this.signalOpts?.e2eeEnabled) {
log.debug('E2EE - setting up transports with insertable streams');
// this makes sure that no data is sent before the transforms are ready
// @ts-ignore
rtcConfig.encodedInsertableStreams = true;
}

if (this.signalOpts?.e2eeEnabled) {
log.debug('E2EE - setting up transports with insertable streams');
Expand Down Expand Up @@ -981,8 +967,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
}

private async waitForPCReconnected() {
// const startTime = Date.now();
// let now = startTime;
this.pcState = PCState.Reconnecting;

log.debug('waiting for peer connection to reconnect');
Expand All @@ -995,6 +979,7 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
this.pcState = PCState.Connected;
} catch (e: any) {
// TODO do we need a `failed` state here for the PC?
this.pcState = PCState.Disconnected;
throw new ConnectionError(`could not establish PC connection, ${e.message}`);
}
}
Expand Down

0 comments on commit 757ad86

Please sign in to comment.