Skip to content

Commit

Permalink
feat: record 관련 type 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
begong313 committed Dec 1, 2024
1 parent dc82009 commit 12e21ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion apps/media/src/record/recordInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ a=receiveonly
`;
};

//todo : producer, consumer가 pause, resume에 따라 스트림 pause, resume
private convertStringToStream = (stringToConvert: string) => {
const stream = new Readable({
read() {
Expand Down
8 changes: 4 additions & 4 deletions apps/media/src/signaling/signaling.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 5 additions & 0 deletions packages/mediasoup/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 12e21ee

Please sign in to comment.