diff --git a/Demo/Sources/Players/PlayerConfiguration.swift b/Demo/Sources/Players/PlayerConfiguration.swift index 73efd134f..5077504ae 100644 --- a/Demo/Sources/Players/PlayerConfiguration.swift +++ b/Demo/Sources/Players/PlayerConfiguration.swift @@ -8,13 +8,19 @@ import Foundation import PillarboxPlayer extension PlayerConfiguration { - static let standard = Self( - usesExternalPlaybackWhileMirroring: !UserDefaults.standard.presenterModeEnabled, - smartNavigationEnabled: UserDefaults.standard.smartNavigationEnabled - ) + static var standard: Self { + let userDefaults = UserDefaults.standard + return .init( + usesExternalPlaybackWhileMirroring: !userDefaults.presenterModeEnabled, + smartNavigationEnabled: userDefaults.smartNavigationEnabled + ) + } - static let externalPlaybackDisabled = Self( - allowsExternalPlayback: false, - smartNavigationEnabled: UserDefaults.standard.smartNavigationEnabled - ) + static var externalPlaybackDisabled: Self { + let userDefaults = UserDefaults.standard + return .init( + allowsExternalPlayback: false, + smartNavigationEnabled: userDefaults.smartNavigationEnabled + ) + } }