Skip to content

Commit 8bb57a3

Browse files
authored
Merge pull request #162 from CS3219-AY2425S1/fix/audio-call
Add debug logs for audio call
2 parents 3988e5b + 10aee49 commit 8bb57a3

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

peerprep-fe/src/app/collaboration/components/AudioSharing.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ const AudioSharing = () => {
2121
process.env.NEXT_PUBLIC_AUDIO_SERVER_URL || 'http://localhost:5555';
2222

2323
// Add TURN server credentials from environment variables
24-
const TURN_SERVER = process.env.NEXT_PUBLIC_TURN_SERVER || 'turn:localhost';
25-
const TURN_USERNAME = process.env.NEXT_PUBLIC_TURN_USERNAME || 'none';
26-
const TURN_CREDENTIAL = process.env.NEXT_PUBLIC_TURN_PASSWORD || 'none';
24+
const TURN_SERVER = process.env.NEXT_PUBLIC_TURN_SERVER;
25+
const TURN_USERNAME = process.env.NEXT_PUBLIC_TURN_USERNAME;
26+
const TURN_CREDENTIAL = process.env.NEXT_PUBLIC_TURN_PASSWORD;
27+
28+
if (!TURN_SERVER || !TURN_USERNAME || !TURN_CREDENTIAL) {
29+
console.error('Missing TURN environment variables');
30+
}
2731

2832
const cleanupAudio = () => {
2933
if (audioStreamRef.current) {
@@ -52,11 +56,11 @@ const AudioSharing = () => {
5256
{ urls: 'stun:stun.l.google.com:19302' },
5357
{ urls: 'stun:global.stun.twilio.com:3478' },
5458
// Add TURN server configuration
55-
{
56-
urls: TURN_SERVER,
57-
username: TURN_USERNAME,
58-
credential: TURN_CREDENTIAL,
59-
},
59+
// {
60+
// urls: TURN_SERVER,
61+
// username: TURN_USERNAME,
62+
// credential: TURN_CREDENTIAL,
63+
// },
6064
],
6165
},
6266
});

0 commit comments

Comments
 (0)