mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Changes to defaults
- Don’t use System Controls with AVPlayer by default - Changed default order of the formats - no default AVPlayer profiles except for tvOS - new constants isIOS, isTvOS, isMacOS - ArtWork for nowPlaying is .medium on iPhone .maxres on all other platforms - changes to the player bar defaults Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
parent
a194738bb6
commit
9a1f0d7aaa
@ -1057,7 +1057,7 @@ final class PlayerModel: ObservableObject {
|
|||||||
|
|
||||||
func updateCurrentArtwork() {
|
func updateCurrentArtwork() {
|
||||||
guard let video = currentVideo,
|
guard let video = currentVideo,
|
||||||
let thumbnailURL = video.thumbnailURL(quality: .medium)
|
let thumbnailURL = video.thumbnailURL(quality: Constants.isIPhone ? .medium : .maxres)
|
||||||
else {
|
else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ struct QualityProfile: Hashable, Identifiable, Defaults.Serializable {
|
|||||||
static var defaultProfile = Self(id: "default", backend: .mpv, resolution: .hd720p60, formats: [.stream], order: Array(Format.allCases.indices))
|
static var defaultProfile = Self(id: "default", backend: .mpv, resolution: .hd720p60, formats: [.stream], order: Array(Format.allCases.indices))
|
||||||
|
|
||||||
enum Format: String, CaseIterable, Identifiable, Defaults.Serializable {
|
enum Format: String, CaseIterable, Identifiable, Defaults.Serializable {
|
||||||
case hls
|
|
||||||
case stream
|
|
||||||
case avc1
|
case avc1
|
||||||
case mp4
|
case mp4
|
||||||
|
case stream
|
||||||
case av1
|
case av1
|
||||||
case webm
|
case webm
|
||||||
|
case hls
|
||||||
|
|
||||||
var id: String {
|
var id: String {
|
||||||
rawValue
|
rawValue
|
||||||
@ -30,18 +30,18 @@ struct QualityProfile: Hashable, Identifiable, Defaults.Serializable {
|
|||||||
|
|
||||||
var streamFormat: Stream.Format? {
|
var streamFormat: Stream.Format? {
|
||||||
switch self {
|
switch self {
|
||||||
case .hls:
|
case .av1:
|
||||||
return nil
|
return .av1
|
||||||
|
case .mp4:
|
||||||
|
return .mp4
|
||||||
case .stream:
|
case .stream:
|
||||||
return nil
|
return nil
|
||||||
case .avc1:
|
case .avc1:
|
||||||
return .avc1
|
return .avc1
|
||||||
case .mp4:
|
|
||||||
return .mp4
|
|
||||||
case .av1:
|
|
||||||
return .av1
|
|
||||||
case .webm:
|
case .webm:
|
||||||
return .webm
|
return .webm
|
||||||
|
case .hls:
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -59,14 +59,16 @@ struct QualityProfile: Hashable, Identifiable, Defaults.Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var formatsDescription: String {
|
var formatsDescription: String {
|
||||||
if formats.count == Format.allCases.count {
|
switch formats.count {
|
||||||
|
case Format.allCases.count:
|
||||||
return "Any format".localized()
|
return "Any format".localized()
|
||||||
}
|
case 0:
|
||||||
if formats.count <= 3 {
|
return "No format selected".localized()
|
||||||
|
case 1 ... 3:
|
||||||
return formats.map(\.description).joined(separator: ", ")
|
return formats.map(\.description).joined(separator: ", ")
|
||||||
|
default:
|
||||||
|
return String(format: "%@ formats".localized(), String(formats.count))
|
||||||
}
|
}
|
||||||
|
|
||||||
return String(format: "%@ formats".localized(), String(formats.count))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isPreferred(_ stream: Stream) -> Bool {
|
func isPreferred(_ stream: Stream) -> Bool {
|
||||||
|
@ -39,6 +39,30 @@ enum Constants {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static var isTvOS: Bool {
|
||||||
|
#if os(tvOS)
|
||||||
|
true
|
||||||
|
#else
|
||||||
|
false
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static var isMacOS: Bool {
|
||||||
|
#if os(macOS)
|
||||||
|
true
|
||||||
|
#else
|
||||||
|
false
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static var isIOS: Bool {
|
||||||
|
#if os(iOS)
|
||||||
|
true
|
||||||
|
#else
|
||||||
|
false
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static var progressViewScale: Double {
|
static var progressViewScale: Double {
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
0.4
|
0.4
|
||||||
|
@ -20,14 +20,14 @@ extension Defaults.Keys {
|
|||||||
static let showOpenActionsToolbarItem = Key<Bool>("showOpenActionsToolbarItem", default: false)
|
static let showOpenActionsToolbarItem = Key<Bool>("showOpenActionsToolbarItem", default: false)
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
static let showDocuments = Key<Bool>("showDocuments", default: false)
|
static let showDocuments = Key<Bool>("showDocuments", default: false)
|
||||||
static let lockPortraitWhenBrowsing = Key<Bool>("lockPortraitWhenBrowsing", default: UIDevice.current.userInterfaceIdiom == .phone)
|
static let lockPortraitWhenBrowsing = Key<Bool>("lockPortraitWhenBrowsing", default: Constants.isIPhone)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !os(tvOS)
|
#if !os(tvOS)
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
static let accountPickerDisplaysUsernameDefault = true
|
static let accountPickerDisplaysUsernameDefault = true
|
||||||
#else
|
#else
|
||||||
static let accountPickerDisplaysUsernameDefault = UIDevice.current.userInterfaceIdiom == .pad
|
static let accountPickerDisplaysUsernameDefault = Constants.isIPad
|
||||||
#endif
|
#endif
|
||||||
static let accountPickerDisplaysUsername = Key<Bool>("accountPickerDisplaysUsername", default: accountPickerDisplaysUsernameDefault)
|
static let accountPickerDisplaysUsername = Key<Bool>("accountPickerDisplaysUsername", default: accountPickerDisplaysUsernameDefault)
|
||||||
#endif
|
#endif
|
||||||
@ -41,9 +41,9 @@ extension Defaults.Keys {
|
|||||||
static let showChannelAvatarInVideosListing = Key<Bool>("showChannelAvatarInVideosListing", default: true)
|
static let showChannelAvatarInVideosListing = Key<Bool>("showChannelAvatarInVideosListing", default: true)
|
||||||
|
|
||||||
static let playerButtonSingleTapGesture = Key<PlayerTapGestureAction>("playerButtonSingleTapGesture", default: .togglePlayer)
|
static let playerButtonSingleTapGesture = Key<PlayerTapGestureAction>("playerButtonSingleTapGesture", default: .togglePlayer)
|
||||||
static let playerButtonDoubleTapGesture = Key<PlayerTapGestureAction>("playerButtonDoubleTapGesture", default: .nothing)
|
static let playerButtonDoubleTapGesture = Key<PlayerTapGestureAction>("playerButtonDoubleTapGesture", default: .togglePlayerVisibility)
|
||||||
static let playerButtonShowsControlButtonsWhenMinimized = Key<Bool>("playerButtonShowsControlButtonsWhenMinimized", default: false)
|
static let playerButtonShowsControlButtonsWhenMinimized = Key<Bool>("playerButtonShowsControlButtonsWhenMinimized", default: true)
|
||||||
static let playerButtonIsExpanded = Key<Bool>("playerButtonIsExpanded", default: false)
|
static let playerButtonIsExpanded = Key<Bool>("playerButtonIsExpanded", default: true)
|
||||||
static let playerBarMaxWidth = Key<String>("playerBarMaxWidth", default: "600")
|
static let playerBarMaxWidth = Key<String>("playerBarMaxWidth", default: "600")
|
||||||
static let channelOnThumbnail = Key<Bool>("channelOnThumbnail", default: false)
|
static let channelOnThumbnail = Key<Bool>("channelOnThumbnail", default: false)
|
||||||
static let timeOnThumbnail = Key<Bool>("timeOnThumbnail", default: true)
|
static let timeOnThumbnail = Key<Bool>("timeOnThumbnail", default: true)
|
||||||
@ -64,7 +64,7 @@ extension Defaults.Keys {
|
|||||||
static let closeVideoOnEOF = Key<Bool>("closeVideoOnEOF", default: false)
|
static let closeVideoOnEOF = Key<Bool>("closeVideoOnEOF", default: false)
|
||||||
|
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
static let pauseOnEnteringBackground = Key<Bool>("pauseOnEnteringBackground", default: true)
|
static let pauseOnEnteringBackground = Key<Bool>("pauseOnEnteringBackground", default: false)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
@ -79,7 +79,7 @@ extension Defaults.Keys {
|
|||||||
|
|
||||||
static let showChapters = Key<Bool>("showChapters", default: true)
|
static let showChapters = Key<Bool>("showChapters", default: true)
|
||||||
static let showChapterThumbnails = Key<Bool>("showChapterThumbnails", default: true)
|
static let showChapterThumbnails = Key<Bool>("showChapterThumbnails", default: true)
|
||||||
static let showChapterThumbnailsOnlyWhenDifferent = Key<Bool>("showChapterThumbnailsOnlyWhenDifferent", default: true)
|
static let showChapterThumbnailsOnlyWhenDifferent = Key<Bool>("showChapterThumbnailsOnlyWhenDifferent", default: false)
|
||||||
static let expandChapters = Key<Bool>("expandChapters", default: true)
|
static let expandChapters = Key<Bool>("expandChapters", default: true)
|
||||||
static let showRelated = Key<Bool>("showRelated", default: true)
|
static let showRelated = Key<Bool>("showRelated", default: true)
|
||||||
static let showInspector = Key<ShowInspectorSetting>("showInspector", default: .onlyLocal)
|
static let showInspector = Key<ShowInspectorSetting>("showInspector", default: .onlyLocal)
|
||||||
@ -94,10 +94,10 @@ extension Defaults.Keys {
|
|||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
static let honorSystemOrientationLock = Key<Bool>("honorSystemOrientationLock", default: true)
|
static let honorSystemOrientationLock = Key<Bool>("honorSystemOrientationLock", default: true)
|
||||||
static let enterFullscreenInLandscape = Key<Bool>("enterFullscreenInLandscape", default: UIDevice.current.userInterfaceIdiom == .phone)
|
static let enterFullscreenInLandscape = Key<Bool>("enterFullscreenInLandscape", default: Constants.isIPhone)
|
||||||
static let rotateToLandscapeOnEnterFullScreen = Key<FullScreenRotationSetting>(
|
static let rotateToLandscapeOnEnterFullScreen = Key<FullScreenRotationSetting>(
|
||||||
"rotateToLandscapeOnEnterFullScreen",
|
"rotateToLandscapeOnEnterFullScreen",
|
||||||
default: UIDevice.current.userInterfaceIdiom == .phone ? .landscapeRight : .disabled
|
default: Constants.isIPhone ? .landscapeRight : .disabled
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -116,14 +116,14 @@ extension Defaults.Keys {
|
|||||||
|
|
||||||
// MARK: GROUP - Controls
|
// MARK: GROUP - Controls
|
||||||
|
|
||||||
static let avPlayerUsesSystemControls = Key<Bool>("avPlayerUsesSystemControls", default: true)
|
static let avPlayerUsesSystemControls = Key<Bool>("avPlayerUsesSystemControls", default: Constants.isTvOS)
|
||||||
static let horizontalPlayerGestureEnabled = Key<Bool>("horizontalPlayerGestureEnabled", default: true)
|
static let horizontalPlayerGestureEnabled = Key<Bool>("horizontalPlayerGestureEnabled", default: true)
|
||||||
static let seekGestureSensitivity = Key<Double>("seekGestureSensitivity", default: 30.0)
|
static let seekGestureSensitivity = Key<Double>("seekGestureSensitivity", default: 30.0)
|
||||||
static let seekGestureSpeed = Key<Double>("seekGestureSpeed", default: 0.5)
|
static let seekGestureSpeed = Key<Double>("seekGestureSpeed", default: 0.5)
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
static let playerControlsLayoutDefault = UIDevice.current.userInterfaceIdiom == .pad ? PlayerControlsLayout.medium : .small
|
static let playerControlsLayoutDefault = Constants.isIPad ? PlayerControlsLayout.medium : .small
|
||||||
static let fullScreenPlayerControlsLayoutDefault = UIDevice.current.userInterfaceIdiom == .pad ? PlayerControlsLayout.medium : .small
|
static let fullScreenPlayerControlsLayoutDefault = Constants.isIPad ? PlayerControlsLayout.medium : .small
|
||||||
#elseif os(tvOS)
|
#elseif os(tvOS)
|
||||||
static let playerControlsLayoutDefault = PlayerControlsLayout.tvRegular
|
static let playerControlsLayoutDefault = PlayerControlsLayout.tvRegular
|
||||||
static let fullScreenPlayerControlsLayoutDefault = PlayerControlsLayout.tvRegular
|
static let fullScreenPlayerControlsLayoutDefault = PlayerControlsLayout.tvRegular
|
||||||
@ -175,61 +175,152 @@ extension Defaults.Keys {
|
|||||||
|
|
||||||
// MARK: GROUP - Quality
|
// MARK: GROUP - Quality
|
||||||
|
|
||||||
static let hd2160pMPVProfile = QualityProfile(id: "hd2160pMPVProfile", backend: .mpv, resolution: .hd2160p60, formats: QualityProfile.Format.allCases, order: Array(QualityProfile.Format.allCases.indices))
|
static let hd2160p60MPVProfile = QualityProfile(id: "hd2160p60MPVProfile", backend: .mpv, resolution: .hd2160p60, formats: QualityProfile.Format.allCases, order: Array(QualityProfile.Format.allCases.indices))
|
||||||
static let hd1080pMPVProfile = QualityProfile(id: "hd1080pMPVProfile", backend: .mpv, resolution: .hd1080p60, formats: QualityProfile.Format.allCases, order: Array(QualityProfile.Format.allCases.indices))
|
static let hd1080p60MPVProfile = QualityProfile(id: "hd1080p60MPVProfile", backend: .mpv, resolution: .hd1080p60, formats: QualityProfile.Format.allCases, order: Array(QualityProfile.Format.allCases.indices))
|
||||||
static let hd720pMPVProfile = QualityProfile(id: "hd720pMPVProfile", backend: .mpv, resolution: .hd720p60, formats: QualityProfile.Format.allCases, order: Array(QualityProfile.Format.allCases.indices))
|
static let hd1080pMPVProfile = QualityProfile(id: "hd1080pMPVProfile", backend: .mpv, resolution: .hd1080p30, formats: QualityProfile.Format.allCases, order: Array(QualityProfile.Format.allCases.indices))
|
||||||
static let hd720pAVPlayerProfile = QualityProfile(id: "hd720pAVPlayerProfile", backend: .appleAVPlayer, resolution: .hd720p30, formats: [.hls, .stream], order: Array(QualityProfile.Format.allCases.indices))
|
static let hd720p60MPVProfile = QualityProfile(id: "hd720p60MPVProfile", backend: .mpv, resolution: .hd720p60, formats: QualityProfile.Format.allCases, order: Array(QualityProfile.Format.allCases.indices))
|
||||||
static let sd360pAVPlayerProfile = QualityProfile(id: "sd360pAVPlayerProfile", backend: .appleAVPlayer, resolution: .sd360p30, formats: [.hls, .stream], order: Array(QualityProfile.Format.allCases.indices))
|
static let hd720pMPVProfile = QualityProfile(id: "hd720pMPVProfile", backend: .mpv, resolution: .hd720p30, formats: QualityProfile.Format.allCases, order: Array(QualityProfile.Format.allCases.indices))
|
||||||
|
static let sd360pMPVProfile = QualityProfile(id: "sd360pMPVProfile", backend: .mpv, resolution: .sd360p30, formats: QualityProfile.Format.allCases, order: Array(QualityProfile.Format.allCases.indices))
|
||||||
|
static let hd720pAVPlayerProfile = QualityProfile(id: "hd720pAVPlayerProfile", backend: .appleAVPlayer, resolution: .hd720p30, formats: [.stream, .hls], order: Array(QualityProfile.Format.allCases.indices))
|
||||||
|
static let sd360pAVPlayerProfile = QualityProfile(id: "sd360pAVPlayerProfile", backend: .appleAVPlayer, resolution: .sd360p30, formats: [.stream, .hls], order: Array(QualityProfile.Format.allCases.indices))
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
static let qualityProfilesDefault = UIDevice.current.userInterfaceIdiom == .pad ? [
|
enum QualityProfiles {
|
||||||
hd2160pMPVProfile,
|
// iPad-specific settings
|
||||||
hd1080pMPVProfile,
|
enum iPad {
|
||||||
hd720pMPVProfile,
|
static let qualityProfilesDefault = [
|
||||||
hd720pAVPlayerProfile,
|
hd1080p60MPVProfile,
|
||||||
sd360pAVPlayerProfile
|
hd1080pMPVProfile,
|
||||||
] : [
|
hd720p60MPVProfile,
|
||||||
hd1080pMPVProfile,
|
hd720pMPVProfile
|
||||||
hd720pMPVProfile,
|
]
|
||||||
hd720pAVPlayerProfile,
|
|
||||||
sd360pAVPlayerProfile
|
static let batteryCellularProfileDefault = hd720pMPVProfile.id
|
||||||
]
|
static let batteryNonCellularProfileDefault = hd720p60MPVProfile.id
|
||||||
|
static let chargingCellularProfileDefault = hd1080pMPVProfile.id
|
||||||
|
static let chargingNonCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
}
|
||||||
|
|
||||||
|
// iPhone-specific settings
|
||||||
|
enum iPhone {
|
||||||
|
static let qualityProfilesDefault = [
|
||||||
|
hd1080p60MPVProfile,
|
||||||
|
hd1080pMPVProfile,
|
||||||
|
hd720p60MPVProfile,
|
||||||
|
hd720pMPVProfile,
|
||||||
|
sd360pMPVProfile
|
||||||
|
]
|
||||||
|
|
||||||
|
static let batteryCellularProfileDefault = sd360pMPVProfile.id
|
||||||
|
static let batteryNonCellularProfileDefault = hd720p60MPVProfile.id
|
||||||
|
static let chargingCellularProfileDefault = hd720pMPVProfile.id
|
||||||
|
static let chargingNonCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
}
|
||||||
|
|
||||||
|
// Access the correct profile based on device type
|
||||||
|
static var currentProfile: (qualityProfilesDefault: [QualityProfile], batteryCellularProfileDefault: String, batteryNonCellularProfileDefault: String, chargingCellularProfileDefault: String, chargingNonCellularProfileDefault: String) {
|
||||||
|
if Constants.isIPad {
|
||||||
|
return (
|
||||||
|
qualityProfilesDefault: iPad.qualityProfilesDefault,
|
||||||
|
batteryCellularProfileDefault: iPad.batteryCellularProfileDefault,
|
||||||
|
batteryNonCellularProfileDefault: iPad.batteryNonCellularProfileDefault,
|
||||||
|
chargingCellularProfileDefault: iPad.chargingCellularProfileDefault,
|
||||||
|
chargingNonCellularProfileDefault: iPad.chargingNonCellularProfileDefault
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
qualityProfilesDefault: iPhone.qualityProfilesDefault,
|
||||||
|
batteryCellularProfileDefault: iPhone.batteryCellularProfileDefault,
|
||||||
|
batteryNonCellularProfileDefault: iPhone.batteryNonCellularProfileDefault,
|
||||||
|
chargingCellularProfileDefault: iPhone.chargingCellularProfileDefault,
|
||||||
|
chargingNonCellularProfileDefault: iPhone.chargingNonCellularProfileDefault
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static let batteryCellularProfileDefault = hd720pAVPlayerProfile.id
|
|
||||||
static let batteryNonCellularProfileDefault = hd720pAVPlayerProfile.id
|
|
||||||
static let chargingCellularProfileDefault = hd720pAVPlayerProfile.id
|
|
||||||
static let chargingNonCellularProfileDefault = hd1080pMPVProfile.id
|
|
||||||
#elseif os(tvOS)
|
#elseif os(tvOS)
|
||||||
static let qualityProfilesDefault = [
|
enum QualityProfiles {
|
||||||
hd2160pMPVProfile,
|
// tvOS-specific settings
|
||||||
hd1080pMPVProfile,
|
enum tvOS {
|
||||||
hd720pMPVProfile,
|
static let qualityProfilesDefault = [
|
||||||
hd720pAVPlayerProfile
|
hd2160p60MPVProfile,
|
||||||
]
|
hd1080p60MPVProfile,
|
||||||
static let batteryCellularProfileDefault = hd1080pMPVProfile.id
|
hd720p60MPVProfile,
|
||||||
static let batteryNonCellularProfileDefault = hd1080pMPVProfile.id
|
hd720pAVPlayerProfile
|
||||||
static let chargingCellularProfileDefault = hd1080pMPVProfile.id
|
]
|
||||||
static let chargingNonCellularProfileDefault = hd1080pMPVProfile.id
|
|
||||||
|
static let batteryCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
static let batteryNonCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
static let chargingCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
static let chargingNonCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
}
|
||||||
|
|
||||||
|
// Access the correct profile based on device type
|
||||||
|
static var currentProfile: (qualityProfilesDefault: [QualityProfile], batteryCellularProfileDefault: String, batteryNonCellularProfileDefault: String, chargingCellularProfileDefault: String, chargingNonCellularProfileDefault: String) {
|
||||||
|
(
|
||||||
|
qualityProfilesDefault: tvOS.qualityProfilesDefault,
|
||||||
|
batteryCellularProfileDefault: tvOS.batteryCellularProfileDefault,
|
||||||
|
batteryNonCellularProfileDefault: tvOS.batteryNonCellularProfileDefault,
|
||||||
|
chargingCellularProfileDefault: tvOS.chargingCellularProfileDefault,
|
||||||
|
chargingNonCellularProfileDefault: tvOS.chargingNonCellularProfileDefault
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static let qualityProfilesDefault = [
|
enum QualityProfiles {
|
||||||
hd2160pMPVProfile,
|
// macOS-specific settings
|
||||||
hd1080pMPVProfile,
|
enum macOS {
|
||||||
hd720pMPVProfile,
|
static let qualityProfilesDefault = [
|
||||||
hd720pAVPlayerProfile
|
hd2160p60MPVProfile,
|
||||||
]
|
hd1080p60MPVProfile,
|
||||||
static let batteryCellularProfileDefault = hd1080pMPVProfile.id
|
hd1080pMPVProfile,
|
||||||
static let batteryNonCellularProfileDefault = hd1080pMPVProfile.id
|
hd720p60MPVProfile
|
||||||
static let chargingCellularProfileDefault = hd1080pMPVProfile.id
|
]
|
||||||
static let chargingNonCellularProfileDefault = hd1080pMPVProfile.id
|
|
||||||
|
static let batteryCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
static let batteryNonCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
static let chargingCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
static let chargingNonCellularProfileDefault = hd1080p60MPVProfile.id
|
||||||
|
}
|
||||||
|
|
||||||
|
// Access the correct profile for other platforms
|
||||||
|
static var currentProfile: (qualityProfilesDefault: [QualityProfile], batteryCellularProfileDefault: String, batteryNonCellularProfileDefault: String, chargingCellularProfileDefault: String, chargingNonCellularProfileDefault: String) {
|
||||||
|
(
|
||||||
|
qualityProfilesDefault: macOS.qualityProfilesDefault,
|
||||||
|
batteryCellularProfileDefault: macOS.batteryCellularProfileDefault,
|
||||||
|
batteryNonCellularProfileDefault: macOS.batteryNonCellularProfileDefault,
|
||||||
|
chargingCellularProfileDefault: macOS.chargingCellularProfileDefault,
|
||||||
|
chargingNonCellularProfileDefault: macOS.chargingNonCellularProfileDefault
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static let batteryCellularProfile = Key<QualityProfile.ID>("batteryCellularProfile", default: batteryCellularProfileDefault)
|
static let batteryCellularProfile = Key<QualityProfile.ID>(
|
||||||
static let batteryNonCellularProfile = Key<QualityProfile.ID>("batteryNonCellularProfile", default: batteryNonCellularProfileDefault)
|
"batteryCellularProfile",
|
||||||
static let chargingCellularProfile = Key<QualityProfile.ID>("chargingCellularProfile", default: chargingCellularProfileDefault)
|
default: QualityProfiles.currentProfile.batteryCellularProfileDefault
|
||||||
static let chargingNonCellularProfile = Key<QualityProfile.ID>("chargingNonCellularProfile", default: chargingNonCellularProfileDefault)
|
)
|
||||||
static let forceAVPlayerForLiveStreams = Key<Bool>("forceAVPlayerForLiveStreams", default: true)
|
static let batteryNonCellularProfile = Key<QualityProfile.ID>(
|
||||||
|
"batteryNonCellularProfile",
|
||||||
static let qualityProfiles = Key<[QualityProfile]>("qualityProfiles", default: qualityProfilesDefault)
|
default: QualityProfiles.currentProfile.batteryNonCellularProfileDefault
|
||||||
|
)
|
||||||
|
static let chargingCellularProfile = Key<QualityProfile.ID>(
|
||||||
|
"chargingCellularProfile",
|
||||||
|
default: QualityProfiles.currentProfile.chargingCellularProfileDefault
|
||||||
|
)
|
||||||
|
static let chargingNonCellularProfile = Key<QualityProfile.ID>(
|
||||||
|
"chargingNonCellularProfile",
|
||||||
|
default: QualityProfiles.currentProfile.chargingNonCellularProfileDefault
|
||||||
|
)
|
||||||
|
static let forceAVPlayerForLiveStreams = Key<Bool>(
|
||||||
|
"forceAVPlayerForLiveStreams",
|
||||||
|
default: true
|
||||||
|
)
|
||||||
|
static let qualityProfiles = Key<[QualityProfile]>(
|
||||||
|
"qualityProfiles",
|
||||||
|
default: QualityProfiles.currentProfile.qualityProfilesDefault
|
||||||
|
)
|
||||||
|
|
||||||
// MARK: GROUP - History
|
// MARK: GROUP - History
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ struct QualityProfileForm: View {
|
|||||||
func isFormatDisabled(_ format: QualityProfile.Format) -> Bool {
|
func isFormatDisabled(_ format: QualityProfile.Format) -> Bool {
|
||||||
guard backend == .appleAVPlayer else { return false }
|
guard backend == .appleAVPlayer else { return false }
|
||||||
|
|
||||||
let avPlayerFormats = [QualityProfile.Format.hls, .stream, .mp4]
|
let avPlayerFormats = [.mp4, .stream, QualityProfile.Format.hls]
|
||||||
|
|
||||||
return !avPlayerFormats.contains(format)
|
return !avPlayerFormats.contains(format)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user