@@ -85,15 +85,9 @@ export enum ConnectionState {
8585export const isConnected = ( state : ConnectionState ) : boolean =>
8686 state === ConnectionState . Connected || state === ConnectionState . Disconnecting ;
8787
88- export enum Layout {
89- Tile = "tile" ,
90- Spotlight = "spotlight" ,
91- }
92-
9388export enum CallEvent {
9489 ConnectionState = "connection_state" ,
9590 Participants = "participants" ,
96- Layout = "layout" ,
9791 Close = "close" ,
9892 Destroy = "destroy" ,
9993}
@@ -104,7 +98,6 @@ interface CallEventHandlerMap {
10498 participants : Map < RoomMember , Set < string > > ,
10599 prevParticipants : Map < RoomMember , Set < string > > ,
106100 ) => void ;
107- [ CallEvent . Layout ] : ( layout : Layout ) => void ;
108101 [ CallEvent . Close ] : ( ) => void ;
109102 [ CallEvent . Destroy ] : ( ) => void ;
110103}
@@ -658,14 +651,6 @@ export class ElementCall extends Call {
658651
659652 private settingsStoreCallEncryptionWatcher ?: string ;
660653 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- }
669654
670655 public get presented ( ) : boolean {
671656 return super . presented ;
@@ -902,8 +887,6 @@ export class ElementCall extends Call {
902887 audioInput : MediaDeviceInfo | null ,
903888 videoInput : MediaDeviceInfo | null ,
904889 ) : Promise < void > {
905- this . messaging ! . on ( `action:${ ElementWidgetActions . TileLayout } ` , this . onTileLayout ) ;
906- this . messaging ! . on ( `action:${ ElementWidgetActions . SpotlightLayout } ` , this . onSpotlightLayout ) ;
907890 this . messaging ! . on ( `action:${ ElementWidgetActions . HangupCall } ` , this . onHangup ) ;
908891 this . messaging ! . once ( `action:${ ElementWidgetActions . Close } ` , this . onClose ) ;
909892 this . messaging ! . on ( `action:${ ElementWidgetActions . DeviceMute } ` , this . onDeviceMute ) ;
@@ -947,8 +930,6 @@ export class ElementCall extends Call {
947930 }
948931
949932 public setDisconnected ( ) : void {
950- this . messaging ! . off ( `action:${ ElementWidgetActions . TileLayout } ` , this . onTileLayout ) ;
951- this . messaging ! . off ( `action:${ ElementWidgetActions . SpotlightLayout } ` , this . onSpotlightLayout ) ;
952933 this . messaging ! . off ( `action:${ ElementWidgetActions . HangupCall } ` , this . onHangup ) ;
953934 this . messaging ! . off ( `action:${ ElementWidgetActions . DeviceMute } ` , this . onDeviceMute ) ;
954935 super . setDisconnected ( ) ;
@@ -973,15 +954,6 @@ export class ElementCall extends Call {
973954 if ( this . session . memberships . length === 0 && ! this . presented && ! this . room . isCallRoom ( ) ) this . destroy ( ) ;
974955 } ;
975956
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-
985957 private readonly onMembershipChanged = ( ) : void => this . updateParticipants ( ) ;
986958
987959 private updateParticipants ( ) : void {
@@ -1025,18 +997,6 @@ export class ElementCall extends Call {
1025997 this . close ( ) ;
1026998 } ;
1027999
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-
10401000 public clean ( ) : Promise < void > {
10411001 return Promise . resolve ( ) ;
10421002 }
0 commit comments