@@ -289,17 +289,25 @@ let MTComp = (function () {
289
289
290
290
useEffect ( ( ) => {
291
291
if ( userJoined ) {
292
- let prevUsers : any [ ] = props . participants as [ ] ;
293
- let userData = {
294
- user : userJoined . uid ,
295
- audiostatus : userJoined . hasAudio ,
296
- streamingVideo : true ,
297
- } ;
298
- setUserIds ( ( userIds : any ) => [ ...userIds , userData ] ) ;
292
+ const remoteUsers = client . remoteUsers ;
293
+ let users : {
294
+ user : UID ;
295
+ audiostatus : boolean ;
296
+ streamingVideo : boolean ;
297
+ } [ ] = [ ] ;
298
+ remoteUsers . forEach ( ( user ) => {
299
+ let userData = {
300
+ user : user . uid ,
301
+ audiostatus : user . hasAudio ,
302
+ streamingVideo : user . hasVideo ,
303
+ } ;
304
+ users . push ( userData ) ;
305
+ setUserIds ( ( userIds : any ) => [ ...userIds , userData ] ) ;
306
+ } ) ;
299
307
dispatch (
300
308
changeChildAction (
301
309
"participants" ,
302
- removeDuplicates ( getData ( [ ... prevUsers , userData ] ) . data , "user" ) ,
310
+ removeDuplicates ( getData ( users ) . data , "user" ) ,
303
311
false
304
312
)
305
313
) ;
@@ -341,8 +349,6 @@ let MTComp = (function () {
341
349
}
342
350
} , [ userLeft ] ) ;
343
351
344
- // console.log("sharing", props.sharing);
345
-
346
352
useEffect ( ( ) => {
347
353
if ( updateVolume . userid ) {
348
354
let prevUsers : [ ] = props . participants as [ ] ;
@@ -363,7 +369,8 @@ let MTComp = (function () {
363
369
} , [ updateVolume ] ) ;
364
370
365
371
useEffect ( ( ) => {
366
- let prevUsers : [ ] = props . participants as [ ] ;
372
+ let prevUsers : any = props . participants as [ ] ;
373
+ if ( prevUsers == "" ) return ;
367
374
const updatedItems = prevUsers . map ( ( userInfo : any ) => {
368
375
if ( userInfo . user === localUserVideo ?. uid ) {
369
376
return { ...userInfo , streamingSharing : props . sharing . value } ;
@@ -385,7 +392,8 @@ let MTComp = (function () {
385
392
} , [ props . sharing . value ] ) ;
386
393
387
394
useEffect ( ( ) => {
388
- let prevUsers : [ ] = props . participants as [ ] ;
395
+ let prevUsers : any = props . participants as [ ] ;
396
+ if ( prevUsers == "" ) return ;
389
397
const updatedItems = prevUsers . map ( ( userInfo : any ) => {
390
398
if ( userInfo . user === localUserVideo ?. uid ) {
391
399
return { ...userInfo , streamingVideo : localUserVideo ?. hasVideo } ;
@@ -512,12 +520,12 @@ let MTComp = (function () {
512
520
styles = { {
513
521
wrapper : {
514
522
maxHeight : "100%" ,
515
- maxWidth : "100%"
516
- } ,
523
+ maxWidth : "100%" ,
524
+ } ,
517
525
body : {
518
526
padding : 0 ,
519
527
backgroundColor : props . style . background ,
520
- }
528
+ } ,
521
529
} }
522
530
closable = { false }
523
531
placement = { props . placement }
@@ -569,8 +577,10 @@ let MTComp = (function () {
569
577
)
570
578
. setPropertyViewFn ( ( children ) => (
571
579
< >
572
- { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
573
- < > < Section name = { sectionNames . meetings } >
580
+ { ( useContext ( EditorContext ) . editorModeStatus === "logic" ||
581
+ useContext ( EditorContext ) . editorModeStatus === "both" ) && (
582
+ < >
583
+ < Section name = { sectionNames . meetings } >
574
584
{ children . appId . propertyView ( {
575
585
label : trans ( "meeting.appid" ) ,
576
586
} ) }
@@ -593,38 +603,40 @@ let MTComp = (function () {
593
603
</ >
594
604
) }
595
605
596
- { ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
597
- < > < Section name = { sectionNames . layout } >
598
- { children . placement . propertyView ( {
599
- label : trans ( "drawer.placement" ) ,
600
- radioButton : true ,
601
- } ) }
602
- { [ "top" , "bottom" ] . includes ( children . placement . getView ( ) )
603
- ? children . autoHeight . getPropertyView ( )
604
- : children . width . propertyView ( {
605
- label : trans ( "drawer.width" ) ,
606
- tooltip : trans ( "drawer.widthTooltip" ) ,
606
+ { ( useContext ( EditorContext ) . editorModeStatus === "layout" ||
607
+ useContext ( EditorContext ) . editorModeStatus === "both" ) && (
608
+ < >
609
+ < Section name = { sectionNames . layout } >
610
+ { children . placement . propertyView ( {
611
+ label : trans ( "drawer.placement" ) ,
612
+ radioButton : true ,
613
+ } ) }
614
+ { [ "top" , "bottom" ] . includes ( children . placement . getView ( ) )
615
+ ? children . autoHeight . getPropertyView ( )
616
+ : children . width . propertyView ( {
617
+ label : trans ( "drawer.width" ) ,
618
+ tooltip : trans ( "drawer.widthTooltip" ) ,
619
+ placeholder : DEFAULT_SIZE + "" ,
620
+ } ) }
621
+ { ! children . autoHeight . getView ( ) &&
622
+ [ "top" , "bottom" ] . includes ( children . placement . getView ( ) ) &&
623
+ children . height . propertyView ( {
624
+ label : trans ( "drawer.height" ) ,
625
+ tooltip : trans ( "drawer.heightTooltip" ) ,
607
626
placeholder : DEFAULT_SIZE + "" ,
608
627
} ) }
609
- { ! children . autoHeight . getView ( ) &&
610
- [ "top" , "bottom" ] . includes ( children . placement . getView ( ) ) &&
611
- children . height . propertyView ( {
612
- label : trans ( "drawer.height" ) ,
613
- tooltip : trans ( "drawer.heightTooltip" ) ,
614
- placeholder : DEFAULT_SIZE + "" ,
628
+ { children . maskClosable . propertyView ( {
629
+ label : trans ( "prop.maskClosable" ) ,
630
+ } ) }
631
+ { children . showMask . propertyView ( {
632
+ label : trans ( "prop.showMask" ) ,
615
633
} ) }
616
- { children . maskClosable . propertyView ( {
617
- label : trans ( "prop.maskClosable" ) ,
618
- } ) }
619
- { children . showMask . propertyView ( {
620
- label : trans ( "prop.showMask" ) ,
621
- } ) }
622
- </ Section >
623
-
624
- < Section name = { sectionNames . style } >
625
-
626
- { children . style . getPropertyView ( ) }
627
- </ Section > </ >
634
+ </ Section >
635
+
636
+ < Section name = { sectionNames . style } >
637
+ { children . style . getPropertyView ( ) }
638
+ </ Section >
639
+ </ >
628
640
) }
629
641
</ >
630
642
) )
@@ -720,24 +732,16 @@ MTComp = withMethodExposing(MTComp, [
720
732
comp . children . localUserID . getView ( ) . value === ""
721
733
? uuidv4 ( )
722
734
: comp . children . localUserID . getView ( ) . value ;
723
- comp . children . localUser . change ( {
735
+ let user = {
724
736
user : userId + "" ,
725
737
audiostatus : false ,
726
738
speaking : false ,
727
739
streamingVideo : true ,
728
- } ) ;
740
+ } ;
741
+ comp . children . localUser . change ( user ) ;
729
742
730
743
comp . children . localUser . children . value . dispatch (
731
- changeChildAction (
732
- "localUser" ,
733
- {
734
- user : userId + "" ,
735
- audiostatus : false ,
736
- speaking : false ,
737
- streamingVideo : true ,
738
- } ,
739
- false
740
- )
744
+ changeChildAction ( "localUser" , user , false )
741
745
) ;
742
746
comp . children . videoControl . change ( true ) ;
743
747
await publishVideo (
0 commit comments