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)
}
// Todo: Use on-offer event intead.
protected async [EVENT.SIGNAL_RESTART]({ sdp }: message.SignalDescription) {
this._localLog.debug(`EVENT.SIGNAL_RESTART`)
protected async [EVENT.SIGNAL_OFFER]({ sdp }: message.SignalDescription) {
this._localLog.debug(`EVENT.SIGNAL_OFFER`)
this.emit('connection.webrtc.sdp', 'remote', 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) {
this._localLog.debug(`EVENT.SIGNAL_CANDIDATE`)
this._connection.webrtc.setCandidate(candidate)