@@ -85,15 +85,9 @@ export enum ConnectionState {
85
85
export const isConnected = ( state : ConnectionState ) : boolean =>
86
86
state === ConnectionState . Connected || state === ConnectionState . Disconnecting ;
87
87
88
- export enum Layout {
89
- Tile = "tile" ,
90
- Spotlight = "spotlight" ,
91
- }
92
-
93
88
export enum CallEvent {
94
89
ConnectionState = "connection_state" ,
95
90
Participants = "participants" ,
96
- Layout = "layout" ,
97
91
Close = "close" ,
98
92
Destroy = "destroy" ,
99
93
}
@@ -104,7 +98,6 @@ interface CallEventHandlerMap {
104
98
participants : Map < RoomMember , Set < string > > ,
105
99
prevParticipants : Map < RoomMember , Set < string > > ,
106
100
) => void ;
107
- [ CallEvent . Layout ] : ( layout : Layout ) => void ;
108
101
[ CallEvent . Close ] : ( ) => void ;
109
102
[ CallEvent . Destroy ] : ( ) => void ;
110
103
}
@@ -658,14 +651,6 @@ export class ElementCall extends Call {
658
651
659
652
private settingsStoreCallEncryptionWatcher ?: string ;
660
653
private terminationTimer ?: number ;
661
- private _layout = Layout . Tile ;
662
- public get layout ( ) : Layout {
663
- return this . _layout ;
664
- }
665
- protected set layout ( value : Layout ) {
666
- this . _layout = value ;
667
- this . emit ( CallEvent . Layout , value ) ;
668
- }
669
654
670
655
public get presented ( ) : boolean {
671
656
return super . presented ;
@@ -902,8 +887,6 @@ export class ElementCall extends Call {
902
887
audioInput : MediaDeviceInfo | null ,
903
888
videoInput : MediaDeviceInfo | null ,
904
889
) : Promise < void > {
905
- this . messaging ! . on ( `action:${ ElementWidgetActions . TileLayout } ` , this . onTileLayout ) ;
906
- this . messaging ! . on ( `action:${ ElementWidgetActions . SpotlightLayout } ` , this . onSpotlightLayout ) ;
907
890
this . messaging ! . on ( `action:${ ElementWidgetActions . HangupCall } ` , this . onHangup ) ;
908
891
this . messaging ! . once ( `action:${ ElementWidgetActions . Close } ` , this . onClose ) ;
909
892
this . messaging ! . on ( `action:${ ElementWidgetActions . DeviceMute } ` , this . onDeviceMute ) ;
@@ -947,8 +930,6 @@ export class ElementCall extends Call {
947
930
}
948
931
949
932
public setDisconnected ( ) : void {
950
- this . messaging ! . off ( `action:${ ElementWidgetActions . TileLayout } ` , this . onTileLayout ) ;
951
- this . messaging ! . off ( `action:${ ElementWidgetActions . SpotlightLayout } ` , this . onSpotlightLayout ) ;
952
933
this . messaging ! . off ( `action:${ ElementWidgetActions . HangupCall } ` , this . onHangup ) ;
953
934
this . messaging ! . off ( `action:${ ElementWidgetActions . DeviceMute } ` , this . onDeviceMute ) ;
954
935
super . setDisconnected ( ) ;
@@ -973,15 +954,6 @@ export class ElementCall extends Call {
973
954
if ( this . session . memberships . length === 0 && ! this . presented && ! this . room . isCallRoom ( ) ) this . destroy ( ) ;
974
955
} ;
975
956
976
- /**
977
- * Sets the call's layout.
978
- * @param layout The layout to switch to.
979
- */
980
- public async setLayout ( layout : Layout ) : Promise < void > {
981
- const action = layout === Layout . Tile ? ElementWidgetActions . TileLayout : ElementWidgetActions . SpotlightLayout ;
982
- await this . messaging ! . transport . send ( action , { } ) ;
983
- }
984
-
985
957
private readonly onMembershipChanged = ( ) : void => this . updateParticipants ( ) ;
986
958
987
959
private updateParticipants ( ) : void {
@@ -1025,18 +997,6 @@ export class ElementCall extends Call {
1025
997
this . close ( ) ;
1026
998
} ;
1027
999
1028
- private readonly onTileLayout = async ( ev : CustomEvent < IWidgetApiRequest > ) : Promise < void > => {
1029
- ev . preventDefault ( ) ;
1030
- this . layout = Layout . Tile ;
1031
- this . messaging ! . transport . reply ( ev . detail , { } ) ; // ack
1032
- } ;
1033
-
1034
- private readonly onSpotlightLayout = async ( ev : CustomEvent < IWidgetApiRequest > ) : Promise < void > => {
1035
- ev . preventDefault ( ) ;
1036
- this . layout = Layout . Spotlight ;
1037
- this . messaging ! . transport . reply ( ev . detail , { } ) ; // ack
1038
- } ;
1039
-
1040
1000
public clean ( ) : Promise < void > {
1041
1001
return Promise . resolve ( ) ;
1042
1002
}
0 commit comments