INNER CODE UNIT · JavaScript
sendOffer
feross/simple-peer · index.js:616
const sendOffer = () => {
if (this.destroyed) return
const signal = this._pc.localDescription || offer
this._debug('signal')
this.emit('signal', {
type: signal.type,
sdp: signal.sdp
})
}
const onSuccess = () => {
this._debug('createOffer success')
if (this.destroyed) return
if (this.trickle || this._iceComplete) sendOffer()
else this.once('_iceComplete', sendOffer) // wait for candidates
}
const onError = err => {