|
@@ -234,10 +234,6 @@ export default function JitsiConference(options) {
|
234
|
234
|
this.videoSIPGWHandler = new VideoSIPGW(this.room);
|
235
|
235
|
this.recordingManager = new RecordingManager(this.room);
|
236
|
236
|
this._conferenceJoinAnalyticsEventSent = false;
|
237
|
|
-
|
238
|
|
- if (this.isE2EESupported()) {
|
239
|
|
- this._e2eEncryption = new E2EEncryption(this, { salt: this.options.name });
|
240
|
|
- }
|
241
|
237
|
}
|
242
|
238
|
|
243
|
239
|
// FIXME convert JitsiConference to ES6 - ASAP !
|
|
@@ -1880,7 +1876,10 @@ JitsiConference.prototype._acceptJvbIncomingCall = function(
|
1880
|
1876
|
}));
|
1881
|
1877
|
|
1882
|
1878
|
try {
|
1883
|
|
- jingleSession.initialize(this.room, this.rtc, this.options.config);
|
|
1879
|
+ jingleSession.initialize(this.room, this.rtc, {
|
|
1880
|
+ ...this.options.config,
|
|
1881
|
+ enableInsertableStreams: Boolean(this._e2eEncryption)
|
|
1882
|
+ });
|
1884
|
1883
|
} catch (error) {
|
1885
|
1884
|
GlobalOnErrorHandler.callErrorHandler(error);
|
1886
|
1885
|
}
|
|
@@ -2639,7 +2638,12 @@ JitsiConference.prototype._acceptP2PIncomingCall = function(
|
2639
|
2638
|
this.p2pJingleSession = jingleSession;
|
2640
|
2639
|
this._sendConferenceJoinAnalyticsEvent();
|
2641
|
2640
|
|
2642
|
|
- this.p2pJingleSession.initialize(this.room, this.rtc, this.options.config);
|
|
2641
|
+ this.p2pJingleSession.initialize(
|
|
2642
|
+ this.room,
|
|
2643
|
+ this.rtc, {
|
|
2644
|
+ ...this.options.config,
|
|
2645
|
+ enableInsertableStreams: Boolean(this._e2eEncryption)
|
|
2646
|
+ });
|
2643
|
2647
|
|
2644
|
2648
|
logger.info('Starting CallStats for P2P connection...');
|
2645
|
2649
|
|
|
@@ -2995,7 +2999,12 @@ JitsiConference.prototype._startP2PSession = function(remoteJid) {
|
2995
|
2999
|
'Created new P2P JingleSession', this.room.myroomjid, remoteJid);
|
2996
|
3000
|
this._sendConferenceJoinAnalyticsEvent();
|
2997
|
3001
|
|
2998
|
|
- this.p2pJingleSession.initialize(this.room, this.rtc, this.options.config);
|
|
3002
|
+ this.p2pJingleSession.initialize(
|
|
3003
|
+ this.room,
|
|
3004
|
+ this.rtc, {
|
|
3005
|
+ ...this.options.config,
|
|
3006
|
+ enableInsertableStreams: Boolean(this._e2eEncryption)
|
|
3007
|
+ });
|
2999
|
3008
|
|
3000
|
3009
|
logger.info('Starting CallStats for P2P connection...');
|
3001
|
3010
|
|
|
@@ -3345,6 +3354,35 @@ JitsiConference.prototype.isE2EESupported = function() {
|
3345
|
3354
|
return browser.supportsInsertableStreams() && !(config.testing && config.testing.disableE2EE);
|
3346
|
3355
|
};
|
3347
|
3356
|
|
|
3357
|
+/**
|
|
3358
|
+ * Initializes the E2E encryption module. Currently any active media session muste be restarted due to
|
|
3359
|
+ * the limitation that the insertable streams constraint can only be set when a new PeerConnection instance is created.
|
|
3360
|
+ *
|
|
3361
|
+ * @private
|
|
3362
|
+ * @returns {void}
|
|
3363
|
+ */
|
|
3364
|
+JitsiConference.prototype._initializeE2EEncryption = function() {
|
|
3365
|
+ this._e2eEncryption = new E2EEncryption(this, { salt: this.options.name });
|
|
3366
|
+
|
|
3367
|
+ // Need to re-create the peerconnections in order to apply the insertable streams constraint
|
|
3368
|
+ this.p2pJingleSession && this.stopP2PSession();
|
|
3369
|
+
|
|
3370
|
+ const jvbJingleSession = this.jvbJingleSession;
|
|
3371
|
+
|
|
3372
|
+ jvbJingleSession && jvbJingleSession.terminate(
|
|
3373
|
+ null /* success callback => we don't care */,
|
|
3374
|
+ error => {
|
|
3375
|
+ logger.warn(`An error occurred while trying to terminate ${jvbJingleSession}`, error);
|
|
3376
|
+ }, {
|
|
3377
|
+ reason: 'success',
|
|
3378
|
+ reasonDescription: 'restart required',
|
|
3379
|
+ requestRestart: true,
|
|
3380
|
+ sendSessionTerminate: true
|
|
3381
|
+ });
|
|
3382
|
+
|
|
3383
|
+ this._maybeStartOrStopP2P(false);
|
|
3384
|
+};
|
|
3385
|
+
|
3348
|
3386
|
/**
|
3349
|
3387
|
* Sets the key to be used for End-To-End encryption.
|
3350
|
3388
|
*
|
|
@@ -3352,12 +3390,16 @@ JitsiConference.prototype.isE2EESupported = function() {
|
3352
|
3390
|
* @returns {void}
|
3353
|
3391
|
*/
|
3354
|
3392
|
JitsiConference.prototype.setE2EEKey = function(key) {
|
3355
|
|
- if (!this._e2eEncryption) {
|
3356
|
|
- logger.warn('Cannot set E2EE key: there is no defined context, platform is likely unsupported.');
|
|
3393
|
+ if (!this.isE2EESupported()) {
|
|
3394
|
+ logger.warn('Cannot set E2EE key: platform is not supported.');
|
3357
|
3395
|
|
3358
|
3396
|
return;
|
3359
|
3397
|
}
|
3360
|
3398
|
|
|
3399
|
+ if (!this._e2eEncryption) {
|
|
3400
|
+ this._initializeE2EEncryption();
|
|
3401
|
+ }
|
|
3402
|
+
|
3361
|
3403
|
this._e2eEncryption.setKey(key);
|
3362
|
3404
|
};
|
3363
|
3405
|
|