diff --git a/services/discord-gateway/src/modules/voice-recording/screenShareController.ts b/services/discord-gateway/src/modules/voice-recording/screenShareController.ts index 54fadb5..992bca4 100644 --- a/services/discord-gateway/src/modules/voice-recording/screenShareController.ts +++ b/services/discord-gateway/src/modules/voice-recording/screenShareController.ts @@ -74,7 +74,20 @@ export class ScreenShareController { `Voice channel ${status.activeChannelId} not found for screen share`, ); } - await this.streamer.joinVoiceChannel(channel); + await Promise.race([ + this.streamer.joinVoiceChannel(channel), + new Promise((_, reject) => + setTimeout( + () => + reject( + new Error( + "Timed out joining voice channel for screen share (2 koneksi voice bertabrakan?)", + ), + ), + 15000, + ), + ), + ]); const { command, output } = prepareStream(directUrl, { encoder: Encoders.software({ x264: { preset: "superfast" } }),