Created
August 3, 2020 07:40
-
-
Save Vatsalya-singhi/b4a2fa19c2227d68b1ab7f00070190c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public candidateListen() { | |
this.socket.candidateListen() | |
.pipe(takeWhile(() => this.alive)) | |
.subscribe((data) => { | |
let id: string = data.id; | |
let candidate: RTCIceCandidate = new RTCIceCandidate(data.candidate); | |
if (!this.peerConnections[id] || this.peerConnections[id] == null) { | |
this.peerConnections[id] = new RTCPeerConnection(this.connectionConfig); | |
} | |
this.peerConnections[id].addIceCandidate(candidate).then(() => { | |
console.log('addIceCandidate success'); | |
}).catch((err) => { | |
// console.log('err=>', err); | |
}); | |
}, (err) => { | |
console.log('err=>', err); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment