Skip to content

Commit 61df1dd

Browse files
authored
Remove the Element Call Picture in Picture feature flag. (#3204)
1 parent 812c5d5 commit 61df1dd

File tree

8 files changed

+9
-19
lines changed

8 files changed

+9
-19
lines changed

ElementX/Sources/Application/AppCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
659659

660660
let callScreenCoordinator = CallScreenCoordinator(parameters: .init(elementCallService: elementCallService,
661661
configuration: configuration,
662-
elementCallPictureInPictureEnabled: false,
662+
allowPictureInPicture: false,
663663
appHooks: appHooks))
664664

665665
callScreenCoordinator.actions

ElementX/Sources/Application/AppSettings.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ final class AppSettings {
4747
case publicSearchEnabled
4848
case fuzzyRoomListSearchEnabled
4949
case pinningEnabled
50-
case elementCallPictureInPictureEnabled
5150
}
5251

5352
private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier
@@ -285,9 +284,6 @@ final class AppSettings {
285284

286285
@UserPreference(key: UserDefaultsKeys.pinningEnabled, defaultValue: false, storageType: .userDefaults(store))
287286
var pinningEnabled
288-
289-
@UserPreference(key: UserDefaultsKeys.elementCallPictureInPictureEnabled, defaultValue: false, storageType: .userDefaults(store))
290-
var elementCallPictureInPictureEnabled
291287

292288
#endif
293289

ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
589589

590590
let callScreenCoordinator = CallScreenCoordinator(parameters: .init(elementCallService: elementCallService,
591591
configuration: configuration,
592-
elementCallPictureInPictureEnabled: appSettings.elementCallPictureInPictureEnabled,
592+
allowPictureInPicture: true,
593593
appHooks: appHooks))
594594

595595
callScreenCoordinator.actions

ElementX/Sources/Screens/CallScreen/CallScreenCoordinator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import SwiftUI
2121
struct CallScreenCoordinatorParameters {
2222
let elementCallService: ElementCallServiceProtocol
2323
let configuration: ElementCallConfiguration
24-
let elementCallPictureInPictureEnabled: Bool
24+
let allowPictureInPicture: Bool
2525
let appHooks: AppHooks
2626
}
2727

@@ -46,7 +46,7 @@ final class CallScreenCoordinator: CoordinatorProtocol {
4646
init(parameters: CallScreenCoordinatorParameters) {
4747
viewModel = CallScreenViewModel(elementCallService: parameters.elementCallService,
4848
configuration: parameters.configuration,
49-
elementCallPictureInPictureEnabled: parameters.elementCallPictureInPictureEnabled,
49+
allowPictureInPicture: parameters.allowPictureInPicture,
5050
appHooks: parameters.appHooks)
5151
}
5252

ElementX/Sources/Screens/CallScreen/CallScreenViewModel.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typealias CallScreenViewModelType = StateStoreViewModel<CallScreenViewState, Cal
2424
class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol {
2525
private let elementCallService: ElementCallServiceProtocol
2626
private let configuration: ElementCallConfiguration
27-
private let isPictureInPictureEnabled: Bool
27+
private let isPictureInPictureAllowed: Bool
2828

2929
private let widgetDriver: ElementCallWidgetDriverProtocol
3030

@@ -43,11 +43,11 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
4343
/// - clientID: Something to identify the current client on the Element Call side
4444
init(elementCallService: ElementCallServiceProtocol,
4545
configuration: ElementCallConfiguration,
46-
elementCallPictureInPictureEnabled: Bool,
46+
allowPictureInPicture: Bool,
4747
appHooks: AppHooks) {
4848
self.elementCallService = elementCallService
4949
self.configuration = configuration
50-
isPictureInPictureEnabled = elementCallPictureInPictureEnabled
50+
isPictureInPictureAllowed = allowPictureInPicture
5151

5252
switch configuration.kind {
5353
case .genericCallLink(let url):
@@ -189,7 +189,7 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
189189

190190
private func handleBackwardsNavigation() async {
191191
guard state.url != nil,
192-
isPictureInPictureEnabled,
192+
isPictureInPictureAllowed,
193193
let requestPictureInPictureHandler = state.bindings.requestPictureInPictureHandler else {
194194
actionsSubject.send(.dismiss)
195195
return

ElementX/Sources/Screens/CallScreen/View/CallScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ struct CallScreen_Previews: PreviewProvider {
300300
elementCallBaseURL: "https://call.element.io",
301301
elementCallBaseURLOverride: nil,
302302
colorScheme: .light),
303-
elementCallPictureInPictureEnabled: false,
303+
allowPictureInPicture: false,
304304
appHooks: AppHooks())
305305
}()
306306

ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ protocol DeveloperOptionsProtocol: AnyObject {
5353
var elementCallBaseURLOverride: URL? { get set }
5454
var fuzzyRoomListSearchEnabled: Bool { get set }
5555
var pinningEnabled: Bool { get set }
56-
var elementCallPictureInPictureEnabled: Bool { get set }
5756
}
5857

5958
extension AppSettings: DeveloperOptionsProtocol { }

ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ struct DeveloperOptionsScreen: View {
6969
context.elementCallBaseURLOverride = url
7070
}
7171
}
72-
73-
Toggle(isOn: $context.elementCallPictureInPictureEnabled) {
74-
Text("Picture in Picture support")
75-
Text("Requires an Element Call deployment with support for signalling PiP availability.")
76-
}
7772
} header: {
7873
Text("Element Call")
7974
} footer: {

0 commit comments

Comments
 (0)