diff --git a/src/component/internal/messages.ts b/src/component/internal/messages.ts index 6b46909c..b911eb0d 100644 --- a/src/component/internal/messages.ts +++ b/src/component/internal/messages.ts @@ -82,9 +82,8 @@ export class NekoMessages extends EventEmitter { 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 { } // 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) diff --git a/src/component/types/events.ts b/src/component/types/events.ts index ea74e34e..9311cabe 100644 --- a/src/component/types/events.ts +++ b/src/component/types/events.ts @@ -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' diff --git a/src/component/types/messages.ts b/src/component/types/messages.ts index 9b294f42..1139b87d 100644 --- a/src/component/types/messages.ts +++ b/src/component/types/messages.ts @@ -48,7 +48,7 @@ export interface SignalProvide { export type SignalCandidate = RTCIceCandidateInit -export interface SignalAnswer { +export interface SignalDescription { sdp: string }