Removing useless roomID parameter in WebRtcSignal message
This commit is contained in:
parent
0119534283
commit
894f7c8009
@ -9,7 +9,6 @@ export const isWebRtcSignalMessageInterface =
|
|||||||
new tg.IsInterface().withProperties({
|
new tg.IsInterface().withProperties({
|
||||||
userId: tg.isString,
|
userId: tg.isString,
|
||||||
receiverId: tg.isString,
|
receiverId: tg.isString,
|
||||||
roomId: tg.isString,
|
|
||||||
signal: isSignalData
|
signal: isSignalData
|
||||||
}).get();
|
}).get();
|
||||||
export const isWebRtcScreenSharingStartMessageInterface =
|
export const isWebRtcScreenSharingStartMessageInterface =
|
||||||
|
@ -82,7 +82,6 @@ export interface WebRtcDisconnectMessageInterface {
|
|||||||
export interface WebRtcSignalMessageInterface {
|
export interface WebRtcSignalMessageInterface {
|
||||||
userId: string, // TODO: is this needed?
|
userId: string, // TODO: is this needed?
|
||||||
receiverId: string,
|
receiverId: string,
|
||||||
roomId: string,
|
|
||||||
signal: SignalData
|
signal: SignalData
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,22 +187,20 @@ export class Connection implements Connection {
|
|||||||
this.socket.on(EventMessage.CONNECT_ERROR, callback)
|
this.socket.on(EventMessage.CONNECT_ERROR, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
public sendWebrtcSignal(signal: unknown, roomId: string, userId? : string|null, receiverId? : string) {
|
public sendWebrtcSignal(signal: unknown, userId? : string|null, receiverId? : string) {
|
||||||
return this.socket.emit(EventMessage.WEBRTC_SIGNAL, {
|
return this.socket.emit(EventMessage.WEBRTC_SIGNAL, {
|
||||||
userId: userId ? userId : this.userId,
|
userId: userId ? userId : this.userId,
|
||||||
receiverId: receiverId ? receiverId : this.userId,
|
receiverId: receiverId ? receiverId : this.userId,
|
||||||
roomId: roomId,
|
|
||||||
signal: signal
|
signal: signal
|
||||||
});
|
} as WebRtcSignalMessageInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
public sendWebrtcScreenSharingSignal(signal: unknown, roomId: string, userId? : string|null, receiverId? : string) {
|
public sendWebrtcScreenSharingSignal(signal: unknown, userId? : string|null, receiverId? : string) {
|
||||||
return this.socket.emit(EventMessage.WEBRTC_SCREEN_SHARING_SIGNAL, {
|
return this.socket.emit(EventMessage.WEBRTC_SCREEN_SHARING_SIGNAL, {
|
||||||
userId: userId ? userId : this.userId,
|
userId: userId ? userId : this.userId,
|
||||||
receiverId: receiverId ? receiverId : this.userId,
|
receiverId: receiverId ? receiverId : this.userId,
|
||||||
roomId: roomId,
|
|
||||||
signal: signal
|
signal: signal
|
||||||
});
|
} as WebRtcSignalMessageInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
public receiveWebrtcStart(callback: (message: WebRtcStartMessageInterface) => void) {
|
public receiveWebrtcStart(callback: (message: WebRtcStartMessageInterface) => void) {
|
||||||
|
@ -311,7 +311,7 @@ export class SimplePeer {
|
|||||||
*/
|
*/
|
||||||
private sendWebrtcSignal(data: unknown, userId : string) {
|
private sendWebrtcSignal(data: unknown, userId : string) {
|
||||||
try {
|
try {
|
||||||
this.Connection.sendWebrtcSignal(data, this.WebRtcRoomId, null, userId);
|
this.Connection.sendWebrtcSignal(data, null, userId);
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
console.error(`sendWebrtcSignal => ${userId}`, e);
|
console.error(`sendWebrtcSignal => ${userId}`, e);
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ export class SimplePeer {
|
|||||||
private sendWebrtcScreenSharingSignal(data: unknown, userId : string) {
|
private sendWebrtcScreenSharingSignal(data: unknown, userId : string) {
|
||||||
console.log("sendWebrtcScreenSharingSignal", data);
|
console.log("sendWebrtcScreenSharingSignal", data);
|
||||||
try {
|
try {
|
||||||
this.Connection.sendWebrtcScreenSharingSignal(data, this.WebRtcRoomId, null, userId);
|
this.Connection.sendWebrtcScreenSharingSignal(data, null, userId);
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
console.error(`sendWebrtcScreenSharingSignal => ${userId}`, e);
|
console.error(`sendWebrtcScreenSharingSignal => ${userId}`, e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user