From 7160520fa553aeb5ecef114955aae04ff4bc0735 Mon Sep 17 00:00:00 2001 From: Daniel Bernal Date: Mon, 17 Jun 2024 14:07:18 +0200 Subject: [PATCH] Revert "Disable PiP if subfeature is off" This reverts commit 82ad148c11372bd8932af4805df237c8def9bfa0. --- DuckDuckGo.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- DuckDuckGo/YoutubePlayer/DuckPlayer.swift | 11 +---------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 6c712977e6..447fdaf4da 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13021,8 +13021,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { - branch = daniel/duckplayer.pip.subfeature; - kind = branch; + kind = exactVersion; + version = 156.0.0; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d1aa3f5ef9..7f1e18672c 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "branch" : "daniel/duckplayer.pip.subfeature", - "revision" : "dfac22c6048b3d0cdda799b1b6e7b6919f24b686" + "revision" : "e9e239fe5dfeab87dcacbf5a31c8f555623a4ce2", + "version" : "156.0.0" } }, { diff --git a/DuckDuckGo/YoutubePlayer/DuckPlayer.swift b/DuckDuckGo/YoutubePlayer/DuckPlayer.swift index 3996a64106..b6d24743d3 100644 --- a/DuckDuckGo/YoutubePlayer/DuckPlayer.swift +++ b/DuckDuckGo/YoutubePlayer/DuckPlayer.swift @@ -115,7 +115,6 @@ final class DuckPlayer { ) { self.preferences = preferences isFeatureEnabled = privacyConfigurationManager.privacyConfig.isEnabled(featureKey: .duckPlayer) - isPiPFeatureEnabled = privacyConfigurationManager.privacyConfig.isSubfeatureEnabled(DuckPlayerSubfeature.pip) mode = preferences.duckPlayerMode bindDuckPlayerModeIfNeeded() @@ -203,14 +202,7 @@ final class DuckPlayer { @MainActor private func encodedSettings(with webView: WKWebView?) async -> InitialSetupSettings { - var isPiPEnabled = webView?.configuration.allowsPictureInPictureMediaPlayback == true - - // Disable WebView PiP if if the subFeature is off - if !isPiPFeatureEnabled { - webView?.configuration.allowsPictureInPictureMediaPlayback = false - isPiPEnabled = false - } - + let isPiPEnabled = webView?.configuration.allowsPictureInPictureMediaPlayback == true let pip = InitialSetupSettings.PIP(status: isPiPEnabled ? .enabled : .disabled) let playerSettings = InitialSetupSettings.PlayerSettings(pip: pip) @@ -231,7 +223,6 @@ final class DuckPlayer { } private var modeCancellable: AnyCancellable? private var isFeatureEnabledCancellable: AnyCancellable? - private var isPiPFeatureEnabled: Bool private func bindDuckPlayerModeIfNeeded() { if isFeatureEnabled {