@@ -24,6 +24,7 @@ typealias CallScreenViewModelType = StateStoreViewModel<CallScreenViewState, Cal
24
24
class CallScreenViewModel : CallScreenViewModelType , CallScreenViewModelProtocol {
25
25
private let elementCallService : ElementCallServiceProtocol
26
26
private let roomProxy : RoomProxyProtocol
27
+ private let isPictureInPictureEnabled : Bool
27
28
28
29
private let widgetDriver : ElementCallWidgetDriverProtocol
29
30
@@ -46,12 +47,14 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
46
47
clientID: String ,
47
48
elementCallBaseURL: URL ,
48
49
elementCallBaseURLOverride: URL ? ,
50
+ elementCallPictureInPictureEnabled: Bool ,
49
51
colorScheme: ColorScheme ,
50
52
appHooks: AppHooks ) {
51
53
guard let deviceID = clientProxy. deviceID else { fatalError ( " Missing device ID for the call. " ) }
52
54
53
55
self . elementCallService = elementCallService
54
56
self . roomProxy = roomProxy
57
+ isPictureInPictureEnabled = elementCallPictureInPictureEnabled
55
58
56
59
widgetDriver = roomProxy. elementCallWidgetDriver ( deviceID: deviceID)
57
60
@@ -200,14 +203,14 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
200
203
}
201
204
#endif
202
205
203
- guard state. url != nil else {
206
+ guard isPictureInPictureEnabled , state. url != nil else {
204
207
actionsSubject. send ( . dismiss)
205
208
return
206
209
}
207
210
208
211
Task {
209
212
try await state. bindings. javaScriptEvaluator ? ( " controls.enableCompatPip() " )
210
- // TODO: Enable this check when implemented on web.
213
+ // Enable this check when implemented on web.
211
214
// if result as? Bool != true {
212
215
// actionsSubject.send(.dismiss)
213
216
// }
0 commit comments