From 12e21ee28a583a924eeb1011a02903a837db1e2d Mon Sep 17 00:00:00 2001 From: JongBin Noh <95959567+begong313@users.noreply.github.com> Date: Mon, 2 Dec 2024 02:41:55 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20record=20=EA=B4=80=EB=A0=A8=20type=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/media/src/record/recordInfo.ts | 1 - apps/media/src/signaling/signaling.gateway.ts | 8 ++++---- packages/mediasoup/src/events.ts | 5 +++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/media/src/record/recordInfo.ts b/apps/media/src/record/recordInfo.ts index 575ad071..acfc0a26 100644 --- a/apps/media/src/record/recordInfo.ts +++ b/apps/media/src/record/recordInfo.ts @@ -82,7 +82,6 @@ a=receiveonly `; }; - //todo : producer, consumer가 pause, resume에 따라 스트림 pause, resume private convertStringToStream = (stringToConvert: string) => { const stream = new Readable({ read() { diff --git a/apps/media/src/signaling/signaling.gateway.ts b/apps/media/src/signaling/signaling.gateway.ts index 3aab19f1..07ef4c24 100644 --- a/apps/media/src/signaling/signaling.gateway.ts +++ b/apps/media/src/signaling/signaling.gateway.ts @@ -185,22 +185,22 @@ export class SignalingGateway implements OnGatewayDisconnect { return this.mediasoupService.resumeConsumers(client.id, roomId, consumerIds); } - @SubscribeMessage('recordStart') + @SubscribeMessage(SOCKET_EVENTS.startRecord) async recordStart(@ConnectedSocket() client: Socket, @MessageBody('roomId') roomId: string) { await this.recordService.startRecord(roomId, client.id); } - @SubscribeMessage('recordStop') + @SubscribeMessage(SOCKET_EVENTS.stopRecord) recordStop(@MessageBody('roomId') roomId: string) { this.recordService.stopRecord(roomId); } - @SubscribeMessage('recordPause') + @SubscribeMessage(SOCKET_EVENTS.pauseRecord) recordPause(@MessageBody('roomId') roomId: string) { this.recordService.pauseRecord(roomId); } - @SubscribeMessage('recordResume') + @SubscribeMessage(SOCKET_EVENTS.resumeRecord) recordResume(@MessageBody('roomId') roomId: string) { this.recordService.resumeRecord(roomId); } diff --git a/packages/mediasoup/src/events.ts b/packages/mediasoup/src/events.ts index 69947f51..25f6eda3 100644 --- a/packages/mediasoup/src/events.ts +++ b/packages/mediasoup/src/events.ts @@ -37,6 +37,11 @@ export const SOCKET_EVENTS = { resumeAudioConsumers: 'resume-audio-consumers', resumeVideoConsumers: 'resume-video-consumers', resumeConsumers: 'resume-consumers', + // 녹음관련 이벤트 + startRecord: 'start-record', + stopRecord: 'stop-record', + pauseRecord: 'pause-record', + resumeRecord: 'resume-record', } as const; export const TRANSPORT_EVENTS = {