INNER CODE UNIT · JavaScript
sendAnswer
feross/simple-peer · index.js:666
const sendAnswer = () => {
if (this.destroyed) return
const signal = this._pc.localDescription || answer
this._debug('signal')
this.emit('signal', {
type: signal.type,
sdp: signal.sdp
})
if (!this.initiator) this._requestMissingTransceivers()
}
const onSuccess = () => {
if (this.destroyed) return
if (this.trickle || this._iceComplete) sendAnswer()
else this.once('_iceComplete', sendAnswer)
}
const onError = err => {