Skip to content

Commit

Permalink
Apply current demo settings to player instances (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
defagos authored May 8, 2024
1 parent f6f2c4f commit a677e9c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Demo/Sources/Players/PlayerConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
}

0 comments on commit a677e9c

Please sign in to comment.