implement signal offer.

This commit is contained in:
Miroslav Šedivý 2021-11-25 00:02:19 +01:00
parent 40d79e69b0
commit ed600e5588
3 changed files with 5 additions and 5 deletions

View File

@ -82,9 +82,8 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
if (type == 'answer') {
this._connection.websocket.send(EVENT.SIGNAL_ANSWER, { sdp })
//} else if (type == 'offer') {
// // Todo: Implement
// this._connection.websocket.send(EVENT.SIGNAL_OFFER, { sdp })
} else if (type == 'offer') {
this._connection.websocket.send(EVENT.SIGNAL_OFFER, { sdp })
} else {
this._remoteLog.warn(`unsupported negotiation type`, { type })
}
@ -149,7 +148,7 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
}
// Todo: Use on-offer event intead.
protected async [EVENT.SIGNAL_RESTART]({ sdp }: message.SignalAnswer) {
protected async [EVENT.SIGNAL_RESTART]({ sdp }: message.SignalDescription) {
this._localLog.debug(`EVENT.SIGNAL_RESTART`)
this.emit('connection.webrtc.sdp', 'remote', sdp)

View File

@ -5,6 +5,7 @@ export const SYSTEM_DISCONNECT = 'system/disconnect'
export const SIGNAL_REQUEST = 'signal/request'
export const SIGNAL_RESTART = 'signal/restart'
export const SIGNAL_OFFER = 'signal/offer'
export const SIGNAL_ANSWER = 'signal/answer'
export const SIGNAL_PROVIDE = 'signal/provide'
export const SIGNAL_CANDIDATE = 'signal/candidate'

View File

@ -48,7 +48,7 @@ export interface SignalProvide {
export type SignalCandidate = RTCIceCandidateInit
export interface SignalAnswer {
export interface SignalDescription {
sdp: string
}