Skip to content

Commit

Permalink
Merge pull request #270 from Jw705/feature/231212-reconnect-audio
Browse files Browse the repository at this point in the history
feature(#215) κ°•μ˜μžκ°€ μƒˆλ‘œκ³ μΉ¨ ν›„ μž¬μ ‘μ† 해도 μŒμ„±μ΄ 잘 듀리도둝 κ°œμ„ 
  • Loading branch information
platinouss authored Dec 12, 2023
2 parents 69c1488 + 2ccec62 commit e3a6860
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mediaServer/src/RelayServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ export class RelayServer {
}
const RTCPC = new RTCPeerConnection(pc_config);
this.clientsConnectionInfo.set(email, new ClientConnectionInfo(RTCPC));
this.roomsConnectionInfo.set(data.roomId, new RoomConnectionInfo(RTCPC));
socket.join(email);
if (roomInfo.presenterEmail !== email) {
this.roomsConnectionInfo.set(data.roomId, new RoomConnectionInfo(RTCPC));
if (await isQuestionStreamExisted(data.roomId)) {
await deleteQuestionStream(data.roomId);
}
Expand All @@ -82,6 +82,11 @@ export class RelayServer {
const roomInfo = this.roomsConnectionInfo.get(data.roomId);
if (roomInfo) {
roomInfo.stream = event.streams[0];
roomInfo.studentInfoList.forEach((clientConnectionInfo: ClientConnectionInfo) => {
event.streams[0].getTracks().forEach((track: any) => {
clientConnectionInfo.RTCPC.getSenders()[0].replaceTrack(track);
});
});
mediaConverter.setSink(event.streams[0], data.roomId);
}
};
Expand Down

0 comments on commit e3a6860

Please sign in to comment.