Skip to content

Commit

Permalink
Set encodedInsertableStreams also for reconnect response
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Nov 2, 2023
1 parent 525d90c commit 9ad5e65
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/room/RTCEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,13 +997,20 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
const res = await this.client.reconnect(this.url, this.token, this.participantSid, reason);
if (res) {
const rtcConfig = this.makeRTCConfiguration(res);
if (this.signalOpts?.e2eeEnabled) {
log.debug('E2EE - setting up transports with insertable streams for reconnect');
// this makes sure that no data is sent before the transforms are ready
// @ts-ignore
rtcConfig.encodedInsertableStreams = true;
}
this.publisher.setConfiguration(rtcConfig);
this.subscriber.setConfiguration(rtcConfig);
}
} catch (e) {
let message = '';
if (e instanceof Error) {
message = e.message;
log.error(e.message);
}
if (e instanceof ConnectionError && e.reason === ConnectionErrorReason.NotAllowed) {
throw new UnexpectedConnectionState('could not reconnect, token might be expired');
Expand Down

0 comments on commit 9ad5e65

Please sign in to comment.