6
6
CiVideoOn ,
7
7
CiVideoOff ,
8
8
} from "react-icons/ci" ;
9
+ import { RxSpeakerLoud , RxSpeakerOff } from "react-icons/rx" ;
10
+
9
11
import { Button } from "@/components/ui/button" ;
10
12
type VideoCallProps = {
11
13
provider : WebrtcProvider ;
@@ -175,7 +177,6 @@ const VideoCall = ({ provider }: VideoCallProps) => {
175
177
} ;
176
178
177
179
const startCall = async ( ) => {
178
- console . log ( "starting call" ) ;
179
180
setVideoStart ( true ) ;
180
181
console . log ( peerConnectionRef . current ) ;
181
182
if ( peerConnectionRef . current ) {
@@ -205,11 +206,6 @@ const VideoCall = ({ provider }: VideoCallProps) => {
205
206
}
206
207
} ;
207
208
208
- const callButton = async ( ) => {
209
- console . log ( "button pressed" ) ;
210
- await startCall ( ) ;
211
- } ;
212
-
213
209
useEffect ( ( ) => {
214
210
const awarenessListener = ( {
215
211
added,
@@ -223,7 +219,6 @@ const VideoCall = ({ provider }: VideoCallProps) => {
223
219
added . concat ( updated ) . forEach ( ( clientId ) => {
224
220
if ( clientId !== provider . awareness . clientID ) {
225
221
const state = provider . awareness . getStates ( ) . get ( clientId ) ;
226
- console . log ( state ) ;
227
222
if ( state ?. webrtc ) {
228
223
handleSignalingMessage ( state . webrtc ) ;
229
224
}
@@ -233,16 +228,13 @@ const VideoCall = ({ provider }: VideoCallProps) => {
233
228
removed . forEach ( ( clientId ) => {
234
229
console . log ( "Client disconnected:" , clientId ) ;
235
230
if ( remoteVideoRef . current ) {
236
- console . log ( "remote video exists" ) ;
237
231
if ( clientId !== provider . awareness . clientID ) {
238
232
remoteVideoRef . current . srcObject = null ;
239
233
remoteStreamRef . current = null ;
240
234
setRemoteVideoSourceObject ( false ) ;
241
235
iceCandidatesQueue . current = [ ] ;
242
236
startPC ( ) ;
243
- console . log ( `Video start ${ videoStart } ` ) ;
244
237
if ( videoStart ) {
245
- console . log ( "restarting call" ) ;
246
238
startCall ( ) ;
247
239
}
248
240
} else {
@@ -314,16 +306,16 @@ const VideoCall = ({ provider }: VideoCallProps) => {
314
306
< div className = "mt-1" >
315
307
< button onClick = { toggleLocalMute } >
316
308
{ isLocalMuted ? (
317
- < CiMicrophoneOff className = "text-lg " />
309
+ < CiMicrophoneOff className = "text-2xl text-red " />
318
310
) : (
319
- < CiMicrophoneOn className = "text-lg " />
311
+ < CiMicrophoneOn className = "text-2xl " />
320
312
) }
321
313
</ button >
322
314
< button onClick = { toggleLocalVideo } >
323
315
{ isLocalVideoOn ? (
324
- < CiVideoOn className = "text-lg " />
316
+ < CiVideoOn className = "text-2xl " />
325
317
) : (
326
- < CiVideoOff className = "text-lg " />
318
+ < CiVideoOff className = "text-2xl text-red " />
327
319
) }
328
320
</ button >
329
321
</ div >
@@ -344,24 +336,24 @@ const VideoCall = ({ provider }: VideoCallProps) => {
344
336
< div className = "mt-1" >
345
337
< button onClick = { toggleRemoteMute } >
346
338
{ isRemoteMuted ? (
347
- < CiMicrophoneOff className = "text-lg " />
339
+ < RxSpeakerOff className = "text-2xl text-red " />
348
340
) : (
349
- < CiMicrophoneOn className = "text-lg " />
341
+ < RxSpeakerLoud className = "text-2xl " />
350
342
) }
351
343
</ button >
352
344
< button onClick = { toggleRemoteVideo } >
353
345
{ isRemoteVideoOn ? (
354
- < CiVideoOn className = "text-lg " />
346
+ < CiVideoOn className = "text-2xl " />
355
347
) : (
356
- < CiVideoOff className = "text-lg " />
348
+ < CiVideoOff className = "text-2xl text-red " />
357
349
) }
358
350
</ button >
359
351
</ div >
360
352
) }
361
353
</ div >
362
354
</ div >
363
355
{ ! videoStart && (
364
- < Button onClick = { callButton } className = "self-end ml-4" >
356
+ < Button onClick = { startCall } className = "self-end ml-4" >
365
357
Start Video Call
366
358
</ Button >
367
359
) }
0 commit comments