From 757ad86525ed0679ee059afb9deb5cf4db3f8d15 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Mon, 13 Nov 2023 15:23:41 +0200 Subject: [PATCH] more cleanup --- src/room/RTCEngine.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/room/RTCEngine.ts b/src/room/RTCEngine.ts index 3626d6dad7..48f5764140 100644 --- a/src/room/RTCEngine.ts +++ b/src/room/RTCEngine.ts @@ -73,10 +73,6 @@ enum PCState { /** @internal */ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmitter) { - // publisher?: PCTransport; - - // subscriber?: PCTransport; - client: SignalClient; rtcConfig: RTCConfiguration = {}; @@ -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; @@ -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(); @@ -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'); @@ -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'); @@ -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}`); } }