diff --git a/src/content/insertable-streams/endtoend-encryption/js/videopipe.js b/src/content/insertable-streams/endtoend-encryption/js/videopipe.js index 353fcd0ee7..5c9c27f627 100644 --- a/src/content/insertable-streams/endtoend-encryption/js/videopipe.js +++ b/src/content/insertable-streams/endtoend-encryption/js/videopipe.js @@ -22,12 +22,8 @@ 'use strict'; function VideoPipe(stream, forceSend, forceReceive, handler) { - this.pc1 = new RTCPeerConnection({ - encodedInsertableStreams: forceSend, - }); - this.pc2 = new RTCPeerConnection({ - encodedInsertableStreams: forceReceive, - }); + this.pc1 = new RTCPeerConnection(); + this.pc2 = new RTCPeerConnection(); this.pc2.ontrack = handler; stream.getTracks().forEach((track) => this.pc1.addTrack(track, stream)); } @@ -36,14 +32,10 @@ VideoPipe.prototype.negotiate = async function() { this.pc1.onicecandidate = e => this.pc2.addIceCandidate(e.candidate); this.pc2.onicecandidate = e => this.pc1.addIceCandidate(e.candidate); - const offer = await this.pc1.createOffer(); - // Disable video/red to allow for easier inspection in Wireshark. - await this.pc2.setRemoteDescription({type: 'offer', sdp: offer.sdp.replace('red/90000', 'green/90000')}); - await this.pc1.setLocalDescription(offer); - - const answer = await this.pc2.createAnswer(); - await this.pc1.setRemoteDescription(answer); - await this.pc2.setLocalDescription(answer); + await this.pc1.setLocalDescription(); + await this.pc2.setRemoteDescription(this.pc1.localDescription); + await this.pc2.setLocalDescription(); + await this.pc1.setRemoteDescription(this.pc2.localDescription); }; VideoPipe.prototype.close = function() { diff --git a/src/content/insertable-streams/video-analyzer/js/main.js b/src/content/insertable-streams/video-analyzer/js/main.js index 77811d387d..0dde4dfe63 100644 --- a/src/content/insertable-streams/video-analyzer/js/main.js +++ b/src/content/insertable-streams/video-analyzer/js/main.js @@ -104,9 +104,7 @@ async function call() { pc1 = new RTCPeerConnection(); console.log('Created local peer connection object pc1'); pc1.addEventListener('icecandidate', e => onIceCandidate(pc1, e)); - pc2 = new RTCPeerConnection({ - encodedInsertableStreams: true, - }); + pc2 = new RTCPeerConnection(); console.log('Created remote peer connection object pc2'); pc2.addEventListener('icecandidate', e => onIceCandidate(pc2, e)); pc1.addEventListener('iceconnectionstatechange', e => onIceStateChange(pc1, e));