@@ -347,19 +347,19 @@ const VideoCall = ({ URL, mediaOptions }) => {
347
347
isEnded ? ( _b = peerRef . current ) === null || _b === void 0 ? void 0 : _b . close ( ) : ( _c = ws . current ) === null || _c === void 0 ? void 0 : _c . send ( JSON . stringify ( LeavePayload ) ) ;
348
348
remoteVideo . current . srcObject = null ;
349
349
}
350
- const buttonStyling = {
351
- backgroundColor : '#C2FBD7' ,
352
- borderRadius : '50px' ,
353
- borderWidth : '0' ,
354
- boxShadow : 'rgba(0, 0, 0, 0.15) 0px 2px 8px' ,
355
- color : '#008000' ,
356
- cursor : 'pointer' ,
357
- display : 'inline-block' ,
358
- fontFamily : 'Arial, Helvetica, sans-serif' ,
359
- fontSize : '1em' ,
360
- height : '50px' ,
361
- padding : '0 25px' ,
362
- } ;
350
+ // const buttonStyling = {
351
+ // backgroundColor: '#C2FBD7',
352
+ // borderRadius: '50px',
353
+ // borderWidth: '0',
354
+ // boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 8px',
355
+ // color: '#008000',
356
+ // cursor: 'pointer',
357
+ // display: 'inline-block',
358
+ // fontFamily: 'Arial, Helvetica, sans-serif',
359
+ // fontSize: '1em',
360
+ // height: '50px',
361
+ // padding: '0 25px',
362
+ // };
363
363
/* 'conditionally rendering' if WebSocket has a value otherwise on page re-rendering events
364
364
multiple WebSocket connections will be made and error
365
365
every user when one closes their browser
@@ -368,26 +368,140 @@ const VideoCall = ({ URL, mediaOptions }) => {
368
368
ws . current ?
369
369
react_1 . default . createElement ( Socket_1 . default , { ws : ws . current , getUsers : getUsers , handleReceiveCall : handleReceiveCall , handleAnswer : handleAnswer , handleNewIceCandidate : handleNewIceCandidate , endCall : endCall } ) :
370
370
'' ,
371
- react_1 . default . createElement ( "div" , { className : '' , style : { display : 'flex' , justifyContent : 'space-around' , flexDirection : 'column' , padding : '10px' , marginTop : '10%' } } ,
371
+ react_1 . default . createElement ( "div" , { className : '' , style : {
372
+ display : 'flex' ,
373
+ flexDirection : 'column' ,
374
+ justifyContent : 'space-around' ,
375
+ marginTop : '10%' ,
376
+ padding : '10px' ,
377
+ } } ,
372
378
username === '' ?
373
379
react_1 . default . createElement ( react_1 . default . Fragment , null ,
374
- react_1 . default . createElement ( "div" , { className : 'input-div' , style : { display : 'flex' , flexDirection : 'column' , top : '2%' , left : '2%' , margin : '0 auto' , height : '100px' , width : '100px' , justifyContent : 'center' , alignItems : 'center' } } ,
375
- react_1 . default . createElement ( "input" , { className : '' , type : 'text' , placeholder : 'username' , id : "username-field" , onChange : ( e ) => userField = e . target . value , style : { paddingBottom : '40px' , width : '200px' } } ) ,
376
- react_1 . default . createElement ( "button" , { className : '' , "data-testid" : 'submit-username-btn' , onClick : ( ) => handleUsername ( ) , style : buttonStyling } , "Submit Username" ) ) )
380
+ react_1 . default . createElement ( "div" , { className : 'input-div' , style : {
381
+ alignItems : 'center' ,
382
+ display : 'flex' ,
383
+ flexDirection : 'column' ,
384
+ height : '100px' ,
385
+ justifyContent : 'center' ,
386
+ left : '2%' ,
387
+ margin : '0 auto' ,
388
+ top : '2%' ,
389
+ width : '100px'
390
+ } } ,
391
+ react_1 . default . createElement ( "input" , { className : '' , type : 'text' , placeholder : 'username' , id : "username-field" , onChange : ( e ) => userField = e . target . value , style : {
392
+ paddingBottom : '40px' ,
393
+ width : '200px'
394
+ } } ) ,
395
+ react_1 . default . createElement ( "button" , { className : '' , "data-testid" : 'submit-username-btn' , onClick : ( ) => handleUsername ( ) ,
396
+ // style={ buttonStyling }
397
+ style : {
398
+ backgroundColor : '#C2FBD7' ,
399
+ borderRadius : '50px' ,
400
+ borderWidth : '0' ,
401
+ boxShadow : 'rgba(0, 0, 0, 0.15) 0px 2px 8px' ,
402
+ color : '#008000' ,
403
+ cursor : 'pointer' ,
404
+ display : 'inline-block' ,
405
+ fontFamily : 'Arial, Helvetica, sans-serif' ,
406
+ fontSize : '1em' ,
407
+ height : '50px' ,
408
+ padding : '0 25px' ,
409
+ } } , "Submit Username" ) ) )
377
410
:
378
- react_1 . default . createElement ( "div" , { className : 'users-list' , style : { fontFamily : 'Arial, Helvetica, sans-serif' , fontSize : '16px' } } ,
411
+ react_1 . default . createElement ( "div" , { className : 'users-list' , style : {
412
+ fontFamily : 'Arial, Helvetica, sans-serif' ,
413
+ fontSize : '16px'
414
+ } } ,
379
415
"Users connected: " ,
380
416
users ) ,
381
- react_1 . default . createElement ( "div" , { id : "main-video-container" , className : '' , style : { display : 'flex' , flexDirection : 'row' , gap : '100px' , justifyContent : 'center' , alignItems : 'center' } } ,
382
- react_1 . default . createElement ( "div" , { id : "local-video-container" , className : '' , style : { display : 'flex' , flexDirection : 'column' , alignContent : 'center' , justifyContent : 'center' } } ,
417
+ react_1 . default . createElement ( "div" , { id : "main-video-container" , className : '' , style : {
418
+ alignItems : 'center' ,
419
+ display : 'flex' ,
420
+ flexDirection : 'row' ,
421
+ gap : '100px' ,
422
+ justifyContent : 'center'
423
+ } } ,
424
+ react_1 . default . createElement ( "div" , { id : "local-video-container" , className : '' , style : {
425
+ alignContent : 'center' ,
426
+ display : 'flex' ,
427
+ flexDirection : 'column' ,
428
+ justifyContent : 'center'
429
+ } } ,
383
430
react_1 . default . createElement ( VideoComponent_1 . default , { video : localVideo , mediaOptions : mediaOptions } ) ,
384
- react_1 . default . createElement ( "div" , { id : "local-button-container" , className : '' , style : { display : 'flex' , flexDirection : 'row' , gap : '10px' , justifyContent : 'center' , marginTop : '10px' } } ,
385
- react_1 . default . createElement ( "button" , { className : 'share-btn' , "data-testid" : 'share-screen-btn' , onClick : ( ) => shareScreen ( ) , style : buttonStyling } , "Share Screen" ) ,
386
- react_1 . default . createElement ( "button" , { className : 'end-btn' , "data-testid" : 'end-call-btn' , onClick : ( ) => endCall ( false ) , style : Object . assign ( Object . assign ( { } , buttonStyling ) , { backgroundColor : '#ff6961' , color : '#28282B' } ) } , "End Call" ) ) ) ,
387
- react_1 . default . createElement ( "div" , { id : "remote-video-container" , className : '' , style : { display : 'flex' , flexDirection : 'column' , alignContent : 'center' , justifyContent : 'center' } } ,
431
+ react_1 . default . createElement ( "div" , { id : "local-button-container" , className : '' , style : {
432
+ display : 'flex' ,
433
+ flexDirection : 'row' ,
434
+ gap : '10px' ,
435
+ justifyContent : 'center' ,
436
+ marginTop : '10px'
437
+ } } ,
438
+ react_1 . default . createElement ( "button" , { className : 'share-btn' , "data-testid" : 'share-screen-btn' , onClick : ( ) => shareScreen ( ) ,
439
+ // style={buttonStyling}
440
+ style : {
441
+ backgroundColor : '#C2FBD7' ,
442
+ borderRadius : '50px' ,
443
+ borderWidth : '0' ,
444
+ boxShadow : 'rgba(0, 0, 0, 0.15) 0px 2px 8px' ,
445
+ color : '#008000' ,
446
+ cursor : 'pointer' ,
447
+ display : 'inline-block' ,
448
+ fontFamily : 'Arial, Helvetica, sans-serif' ,
449
+ fontSize : '1em' ,
450
+ height : '50px' ,
451
+ padding : '0 25px' ,
452
+ } } , "Share Screen" ) ,
453
+ react_1 . default . createElement ( "button" , { className : 'end-btn' , "data-testid" : 'end-call-btn' , onClick : ( ) => endCall ( false ) ,
454
+ // style={{
455
+ // ...buttonStyling,
456
+ // backgroundColor:'#ff6961',
457
+ // color:'#28282B'
458
+ // }}
459
+ style : {
460
+ // backgroundColor: '#C2FBD7',
461
+ backgroundColor : '#ff6961' ,
462
+ borderRadius : '50px' ,
463
+ borderWidth : '0' ,
464
+ boxShadow : 'rgba(0, 0, 0, 0.15) 0px 2px 8px' ,
465
+ // color: '#008000',
466
+ color : '#28282B' ,
467
+ cursor : 'pointer' ,
468
+ display : 'inline-block' ,
469
+ fontFamily : 'Arial, Helvetica, sans-serif' ,
470
+ fontSize : '1em' ,
471
+ height : '50px' ,
472
+ padding : '0 25px' ,
473
+ } } , "End Call" ) ) ) ,
474
+ react_1 . default . createElement ( "div" , { id : "remote-video-container" , className : '' , style : {
475
+ alignContent : 'center' ,
476
+ display : 'flex' ,
477
+ flexDirection : 'column' ,
478
+ justifyContent : 'center'
479
+ } } ,
388
480
react_1 . default . createElement ( VideoComponent_1 . default , { video : remoteVideo , mediaOptions : mediaOptions } ) ,
389
- react_1 . default . createElement ( "div" , { id : "remote-button-container" , className : '' , style : { display : 'flex' , flexDirection : 'row' , gap : '10px' , justifyContent : 'center' , marginTop : '10px' } } ,
390
- react_1 . default . createElement ( "button" , { className : '' , "data-testid" : 'call-btn' , onClick : handleOffer , style : buttonStyling } , "Call" ) ,
391
- react_1 . default . createElement ( "input" , { className : '' , type : 'text' , id : 'receiverName' , style : { marginLeft : '2%' } } ) ) ) ) ) ) ) ;
481
+ react_1 . default . createElement ( "div" , { id : "remote-button-container" , className : '' , style : {
482
+ display : 'flex' ,
483
+ flexDirection : 'row' ,
484
+ gap : '10px' ,
485
+ justifyContent : 'center' ,
486
+ marginTop : '10px'
487
+ } } ,
488
+ react_1 . default . createElement ( "button" , { className : '' , "data-testid" : 'call-btn' , onClick : handleOffer ,
489
+ // style={buttonStyling}
490
+ style : {
491
+ backgroundColor : '#C2FBD7' ,
492
+ borderRadius : '50px' ,
493
+ borderWidth : '0' ,
494
+ boxShadow : 'rgba(0, 0, 0, 0.15) 0px 2px 8px' ,
495
+ color : '#008000' ,
496
+ cursor : 'pointer' ,
497
+ display : 'inline-block' ,
498
+ fontFamily : 'Arial, Helvetica, sans-serif' ,
499
+ fontSize : '1em' ,
500
+ height : '50px' ,
501
+ padding : '0 25px' ,
502
+ } } , "Call" ) ,
503
+ react_1 . default . createElement ( "input" , { className : '' , type : 'text' , id : 'receiverName' , style : {
504
+ marginLeft : '2%'
505
+ } } ) ) ) ) ) ) ) ;
392
506
} ;
393
507
exports . default = VideoCall ;
0 commit comments