accept offer from server.

This commit is contained in:
Miroslav Šedivý 2021-11-25 21:44:31 +01:00
parent ed600e5588
commit 4479096a48

View File

@ -147,14 +147,18 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
Vue.set(this._state.connection.webrtc, 'video', video) Vue.set(this._state.connection.webrtc, 'video', video)
} }
// Todo: Use on-offer event intead. protected async [EVENT.SIGNAL_OFFER]({ sdp }: message.SignalDescription) {
protected async [EVENT.SIGNAL_RESTART]({ sdp }: message.SignalDescription) { this._localLog.debug(`EVENT.SIGNAL_OFFER`)
this._localLog.debug(`EVENT.SIGNAL_RESTART`)
this.emit('connection.webrtc.sdp', 'remote', sdp) this.emit('connection.webrtc.sdp', 'remote', sdp)
await this._connection.webrtc.setOffer(sdp) await this._connection.webrtc.setOffer(sdp)
} }
// Todo: Use offer event intead.
protected async [EVENT.SIGNAL_RESTART]({ sdp }: message.SignalDescription) {
this[EVENT.SIGNAL_OFFER]({ sdp })
}
protected [EVENT.SIGNAL_CANDIDATE](candidate: message.SignalCandidate) { protected [EVENT.SIGNAL_CANDIDATE](candidate: message.SignalCandidate) {
this._localLog.debug(`EVENT.SIGNAL_CANDIDATE`) this._localLog.debug(`EVENT.SIGNAL_CANDIDATE`)
this._connection.webrtc.setCandidate(candidate) this._connection.webrtc.setCandidate(candidate)