File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,14 @@ export interface UrlParams {
71
71
* is window.controls.onBackButtonPressed.
72
72
*/
73
73
header : HeaderStyle ;
74
+ /**
75
+ * If we want the app to automatically leave the call when all other participants
76
+ * leave the call.
77
+ *
78
+ * This is used in settings where EC should behave more like a phone call other than a conference.
79
+ * Like in a DM.
80
+ */
81
+ telephoneAutoLeave : boolean ;
74
82
/**
75
83
* Whether the controls should be shown. For screen recording no controls can be desired.
76
84
*/
@@ -329,6 +337,7 @@ export const getUrlParams = (
329
337
rageshakeSubmitUrl : parser . getParam ( "rageshakeSubmitUrl" ) ,
330
338
sentryDsn : parser . getParam ( "sentryDsn" ) ,
331
339
sentryEnvironment : parser . getParam ( "sentryEnvironment" ) ,
340
+ telephoneAutoLeave : parser . getFlagParam ( "telephoneAutoLeave" ) ,
332
341
} ;
333
342
} ;
334
343
Original file line number Diff line number Diff line change @@ -166,15 +166,18 @@ export const GroupCallView: FC<Props> = ({
166
166
const { displayName, avatarUrl } = useProfile ( client ) ;
167
167
const roomName = useRoomName ( room ) ;
168
168
const roomAvatar = useRoomAvatar ( room ) ;
169
- const { perParticipantE2EE, returnToLobby } = useUrlParams ( ) ;
169
+ const {
170
+ perParticipantE2EE,
171
+ returnToLobby,
172
+ password : passwordFromUrl ,
173
+ } = useUrlParams ( ) ;
170
174
const e2eeSystem = useRoomEncryptionSystem ( room . roomId ) ;
171
175
const [ useNewMembershipManager ] = useSetting ( useNewMembershipManagerSetting ) ;
172
176
const [ useExperimentalToDeviceTransport ] = useSetting (
173
177
useExperimentalToDeviceTransportSetting ,
174
178
) ;
175
179
176
180
// Save the password once we start the groupCallView
177
- const { password : passwordFromUrl } = useUrlParams ( ) ;
178
181
useEffect ( ( ) => {
179
182
if ( passwordFromUrl ) saveKeyForRoom ( room . roomId , passwordFromUrl ) ;
180
183
} , [ passwordFromUrl , room . roomId ] ) ;
Original file line number Diff line number Diff line change @@ -162,6 +162,8 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
162
162
} ;
163
163
} , [ livekitRoom ] ) ;
164
164
165
+ const { telephoneAutoLeave } = useUrlParams ( ) ;
166
+
165
167
useEffect ( ( ) => {
166
168
if ( livekitRoom !== undefined ) {
167
169
const reactionsReader = new ReactionsReader ( props . rtcSession ) ;
@@ -171,7 +173,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
171
173
mediaDevices ,
172
174
{
173
175
encryptionSystem : props . e2eeSystem ,
174
- autoLeaveWhenOthersLeft : undefined ,
176
+ autoLeaveWhenOthersLeft : telephoneAutoLeave ,
175
177
} ,
176
178
connStateObservable$ ,
177
179
reactionsReader . raisedHands$ ,
@@ -189,6 +191,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
189
191
mediaDevices ,
190
192
props . e2eeSystem ,
191
193
connStateObservable$ ,
194
+ props . telephoneAutoLeave ,
192
195
] ) ;
193
196
194
197
if ( livekitRoom === undefined || vm === null ) return null ;
You can’t perform that action at this time.
0 commit comments