Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Player] Unified caching (1/X): Remove AVQueuePlayerWrapperLegacy implementation #174

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions Sources/Player/Common/Extensions/Player+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import Foundation

extension Player {
static func mainPlayerType(
_ featureFlagProvider: FeatureFlagProvider
) -> MainPlayerType.Type {
if featureFlagProvider.shouldUseImprovedCaching() {
AVQueuePlayerWrapper.self
} else {
AVQueuePlayerWrapperLegacy.self
}
static func mainPlayerType() -> MainPlayerType.Type {
AVQueuePlayerWrapper.self
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ public extension FeatureFlagProvider {
static let standard = FeatureFlagProvider(
shouldUseEventProducer: { false },
isContentCachingEnabled: { true },
shouldUseImprovedCaching: { false },
shouldPauseAndPlayAroundSeek: { false },
shouldNotPerformActionAtItemEnd: { false }
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
public struct FeatureFlagProvider {
public var shouldUseEventProducer: () -> Bool
public var isContentCachingEnabled: () -> Bool
public var shouldUseImprovedCaching: () -> Bool
public var shouldPauseAndPlayAroundSeek: () -> Bool
public var shouldNotPerformActionAtItemEnd: () -> Bool

public init(
shouldUseEventProducer: @escaping () -> Bool,
isContentCachingEnabled: @escaping () -> Bool,
shouldUseImprovedCaching: @escaping () -> Bool,
shouldPauseAndPlayAroundSeek: @escaping () -> Bool,
shouldNotPerformActionAtItemEnd: @escaping () -> Bool
) {
self.shouldUseEventProducer = shouldUseEventProducer
self.isContentCachingEnabled = isContentCachingEnabled
self.shouldUseImprovedCaching = shouldUseImprovedCaching
self.shouldPauseAndPlayAroundSeek = shouldPauseAndPlayAroundSeek
self.shouldNotPerformActionAtItemEnd = shouldNotPerformActionAtItemEnd
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ public extension FeatureFlagProvider {
static let mock = FeatureFlagProvider(
shouldUseEventProducer: { true },
isContentCachingEnabled: { true },
shouldUseImprovedCaching: { false },
shouldPauseAndPlayAroundSeek: { false },
shouldNotPerformActionAtItemEnd: { false }
)
Expand Down

This file was deleted.

Loading
Loading