Skip to content

Commit

Permalink
Revert "Disable PiP if subfeature is off"
Browse files Browse the repository at this point in the history
This reverts commit 82ad148.
  • Loading branch information
afterxleep committed Jun 17, 2024
1 parent 82ad148 commit 7160520
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down
11 changes: 1 addition & 10 deletions DuckDuckGo/YoutubePlayer/DuckPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand All @@ -231,7 +223,6 @@ final class DuckPlayer {
}
private var modeCancellable: AnyCancellable?
private var isFeatureEnabledCancellable: AnyCancellable?
private var isPiPFeatureEnabled: Bool

private func bindDuckPlayerModeIfNeeded() {
if isFeatureEnabled {
Expand Down

0 comments on commit 7160520

Please sign in to comment.