11import { ConfigService } from '@nestjs/config' ;
2- import { Injectable } from '@nestjs/common' ;
2+ import { Inject , Injectable } from '@nestjs/common' ;
33import * as mediasoup from 'mediasoup' ;
44import { ConnectTransportDto } from './dto/transport-params.interface' ;
55import { RoomService } from './services/room.service' ;
@@ -15,6 +15,7 @@ import { ClientService } from './services/client.service';
1515import { RecordService } from './services/record.service' ;
1616import { User } from '../types/user' ;
1717import { SetVideoQualityDto } from './dto/set-video-quality.dto' ;
18+ import { IRecordClient } from 'src/common/clients/record-client.interface' ;
1819
1920@Injectable ( )
2021export class SfuService {
@@ -27,10 +28,15 @@ export class SfuService {
2728 private readonly recordService : RecordService ,
2829 private readonly clientService : ClientService ,
2930 private readonly configService : ConfigService ,
31+ @Inject ( 'RECORD_CLIENT' )
32+ private readonly recordClient : IRecordClient ,
3033 ) { }
3134
3235 async createRoom ( clientId : string , user : User ) {
3336 const room = await this . roomService . createRoom ( ) ;
37+
38+ await this . recordClient . post ( '/thumbnail' , { roomId : room . id } ) ;
39+
3440 const thumbnail = `${ this . configService . get ( 'PUBLIC_RECORD_SERVER_URL' ) } /statics/thumbnails/${ room . id } .jpg` ;
3541 await this . broadcasterService . createBroadcast (
3642 CreateBroadcastDto . of ( room . id , `${ user . camperId } 님의 방송` , thumbnail , user . id ) ,
0 commit comments