Merge branch 'main' into swiftformat-third-times-the-charm
This commit is contained in:
commit
071d07d5ff
|
@ -0,0 +1,26 @@
|
||||||
|
//
|
||||||
|
/*
|
||||||
|
* SwiftFin is subject to the terms of the Mozilla Public
|
||||||
|
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*
|
||||||
|
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if os(tvOS)
|
||||||
|
import TVVLCKit
|
||||||
|
#else
|
||||||
|
import MobileVLCKit
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extension VLCMediaPlayer {
|
||||||
|
/// Applies font size to the player
|
||||||
|
///
|
||||||
|
/// This is pretty hacky until VLCKit 4 has a public API to support this
|
||||||
|
func setSubtitleSize(_ size: SubtitleSize) {
|
||||||
|
perform(
|
||||||
|
Selector(("setTextRendererFontSize:")),
|
||||||
|
with: size.textRendererFontSize
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
//
|
||||||
|
/*
|
||||||
|
* SwiftFin is subject to the terms of the Mozilla Public
|
||||||
|
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*
|
||||||
|
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Defaults
|
||||||
|
|
||||||
|
enum SubtitleSize: Int32, CaseIterable, Defaults.Serializable {
|
||||||
|
case smallest
|
||||||
|
case smaller
|
||||||
|
case regular
|
||||||
|
case larger
|
||||||
|
case largest
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - appearance
|
||||||
|
|
||||||
|
extension SubtitleSize {
|
||||||
|
var label: String {
|
||||||
|
switch self {
|
||||||
|
case .smallest:
|
||||||
|
return "Smallest"
|
||||||
|
case .smaller:
|
||||||
|
return "Smaller"
|
||||||
|
case .regular:
|
||||||
|
return "Regular"
|
||||||
|
case .larger:
|
||||||
|
return "Larger"
|
||||||
|
case .largest:
|
||||||
|
return "Largest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - sizing for VLC
|
||||||
|
|
||||||
|
extension SubtitleSize {
|
||||||
|
/// Value to be passed to VLCKit (via hacky internal property, until VLCKit 4)
|
||||||
|
///
|
||||||
|
/// note that it doesn't correspond to actual font sizes; a smaller int creates bigger text
|
||||||
|
var textRendererFontSize: Int {
|
||||||
|
switch self {
|
||||||
|
case .smallest:
|
||||||
|
return 24
|
||||||
|
case .smaller:
|
||||||
|
return 20
|
||||||
|
case .regular:
|
||||||
|
return 16
|
||||||
|
case .larger:
|
||||||
|
return 12
|
||||||
|
case .largest:
|
||||||
|
return 8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,8 +34,7 @@ extension Defaults.Keys {
|
||||||
static let inNetworkBandwidth = Key<Int>("InNetworkBandwidth", default: 40_000_000, suite: SwiftfinStore.Defaults.generalSuite)
|
static let inNetworkBandwidth = Key<Int>("InNetworkBandwidth", default: 40_000_000, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
static let outOfNetworkBandwidth = Key<Int>("OutOfNetworkBandwidth", default: 40_000_000, suite: SwiftfinStore.Defaults.generalSuite)
|
static let outOfNetworkBandwidth = Key<Int>("OutOfNetworkBandwidth", default: 40_000_000, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
static let isAutoSelectSubtitles = Key<Bool>("isAutoSelectSubtitles", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
static let isAutoSelectSubtitles = Key<Bool>("isAutoSelectSubtitles", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
static let autoSelectSubtitlesLangCode = Key<String>("AutoSelectSubtitlesLangCode", default: "Auto",
|
static let autoSelectSubtitlesLangCode = Key<String>("AutoSelectSubtitlesLangCode", default: "Auto", suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
suite: SwiftfinStore.Defaults.generalSuite)
|
|
||||||
static let autoSelectAudioLangCode = Key<String>("AutoSelectAudioLangCode", default: "Auto", suite: SwiftfinStore.Defaults.generalSuite)
|
static let autoSelectAudioLangCode = Key<String>("AutoSelectAudioLangCode", default: "Auto", suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
|
|
||||||
// Customize settings
|
// Customize settings
|
||||||
|
@ -45,12 +44,11 @@ extension Defaults.Keys {
|
||||||
// Video player / overlay settings
|
// Video player / overlay settings
|
||||||
static let overlayType = Key<OverlayType>("overlayType", default: .normal, suite: SwiftfinStore.Defaults.generalSuite)
|
static let overlayType = Key<OverlayType>("overlayType", default: .normal, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
static let jumpGesturesEnabled = Key<Bool>("gesturesEnabled", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
static let jumpGesturesEnabled = Key<Bool>("gesturesEnabled", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
static let videoPlayerJumpForward = Key<VideoPlayerJumpLength>("videoPlayerJumpForward", default: .fifteen,
|
static let videoPlayerJumpForward = Key<VideoPlayerJumpLength>("videoPlayerJumpForward", default: .fifteen, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
suite: SwiftfinStore.Defaults.generalSuite)
|
static let videoPlayerJumpBackward = Key<VideoPlayerJumpLength>("videoPlayerJumpBackward", default: .fifteen, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
static let videoPlayerJumpBackward = Key<VideoPlayerJumpLength>("videoPlayerJumpBackward", default: .fifteen,
|
|
||||||
suite: SwiftfinStore.Defaults.generalSuite)
|
|
||||||
static let autoplayEnabled = Key<Bool>("autoPlayNextItem", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
static let autoplayEnabled = Key<Bool>("autoPlayNextItem", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
static let resumeOffset = Key<Bool>("resumeOffset", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
static let resumeOffset = Key<Bool>("resumeOffset", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
|
static let subtitleSize = Key<SubtitleSize>("subtitleSize", default: .regular, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
|
|
||||||
// Should show video player items
|
// Should show video player items
|
||||||
static let shouldShowPlayPreviousItem = Key<Bool>("shouldShowPreviousItem", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
static let shouldShowPlayPreviousItem = Key<Bool>("shouldShowPreviousItem", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
|
@ -58,13 +56,11 @@ extension Defaults.Keys {
|
||||||
static let shouldShowAutoPlay = Key<Bool>("shouldShowAutoPlayNextItem", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
static let shouldShowAutoPlay = Key<Bool>("shouldShowAutoPlayNextItem", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
|
|
||||||
// Should show video player items in overlay menu
|
// Should show video player items in overlay menu
|
||||||
static let shouldShowJumpButtonsInOverlayMenu = Key<Bool>("shouldShowJumpButtonsInMenu", default: true,
|
static let shouldShowJumpButtonsInOverlayMenu = Key<Bool>("shouldShowJumpButtonsInMenu", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
suite: SwiftfinStore.Defaults.generalSuite)
|
|
||||||
|
|
||||||
// Experimental settings
|
// Experimental settings
|
||||||
enum Experimental {
|
struct Experimental {
|
||||||
static let syncSubtitleStateWithAdjacent = Key<Bool>("experimental.syncSubtitleState", default: false,
|
static let syncSubtitleStateWithAdjacent = Key<Bool>("experimental.syncSubtitleState", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
suite: SwiftfinStore.Defaults.generalSuite)
|
|
||||||
static let liveTVAlphaEnabled = Key<Bool>("liveTVAlphaEnabled", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
static let liveTVAlphaEnabled = Key<Bool>("liveTVAlphaEnabled", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,27 +13,18 @@ import SwiftUI
|
||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
|
|
||||||
@EnvironmentObject
|
@EnvironmentObject var settingsRouter: SettingsCoordinator.Router
|
||||||
var settingsRouter: SettingsCoordinator.Router
|
@ObservedObject var viewModel: SettingsViewModel
|
||||||
@ObservedObject
|
|
||||||
var viewModel: SettingsViewModel
|
|
||||||
|
|
||||||
@Default(.autoSelectAudioLangCode)
|
@Default(.autoSelectAudioLangCode) var autoSelectAudioLangcode
|
||||||
var autoSelectAudioLangcode
|
@Default(.videoPlayerJumpForward) var jumpForwardLength
|
||||||
@Default(.videoPlayerJumpForward)
|
@Default(.videoPlayerJumpBackward) var jumpBackwardLength
|
||||||
var jumpForwardLength
|
@Default(.downActionShowsMenu) var downActionShowsMenu
|
||||||
@Default(.videoPlayerJumpBackward)
|
@Default(.confirmClose) var confirmClose
|
||||||
var jumpBackwardLength
|
@Default(.tvOSCinematicViews) var tvOSCinematicViews
|
||||||
@Default(.downActionShowsMenu)
|
@Default(.showPosterLabels) var showPosterLabels
|
||||||
var downActionShowsMenu
|
@Default(.resumeOffset) var resumeOffset
|
||||||
@Default(.confirmClose)
|
@Default(.subtitleSize) var subtitleSize
|
||||||
var confirmClose
|
|
||||||
@Default(.tvOSCinematicViews)
|
|
||||||
var tvOSCinematicViews
|
|
||||||
@Default(.showPosterLabels)
|
|
||||||
var showPosterLabels
|
|
||||||
@Default(.resumeOffset)
|
|
||||||
var resumeOffset
|
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
GeometryReader { reader in
|
GeometryReader { reader in
|
||||||
|
@ -47,7 +38,9 @@ struct SettingsView: View {
|
||||||
Form {
|
Form {
|
||||||
Section(header: EmptyView()) {
|
Section(header: EmptyView()) {
|
||||||
|
|
||||||
Button {} label: {
|
Button {
|
||||||
|
|
||||||
|
} label: {
|
||||||
HStack {
|
HStack {
|
||||||
Text("User")
|
Text("User")
|
||||||
Spacer()
|
Spacer()
|
||||||
|
@ -124,11 +117,19 @@ struct SettingsView: View {
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
Toggle("Cinematic Views", isOn: $tvOSCinematicViews)
|
Toggle("Cinematic Views", isOn: $tvOSCinematicViews)
|
||||||
Toggle("Show Poster Labels", isOn: $showPosterLabels)
|
|
||||||
|
|
||||||
} header: {
|
} header: {
|
||||||
Text("Appearance")
|
Text("Appearance")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Section(header: L10n.accessibility.text) {
|
||||||
|
Toggle("Show Poster Labels", isOn: $showPosterLabels)
|
||||||
|
|
||||||
|
Picker("Subtitle size", selection: $subtitleSize) {
|
||||||
|
ForEach(SubtitleSize.allCases, id: \.self) { size in
|
||||||
|
Text(size.label).tag(size.rawValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,7 +391,7 @@ extension VLCPlayerViewController {
|
||||||
// remove old player
|
// remove old player
|
||||||
|
|
||||||
if vlcMediaPlayer.media != nil {
|
if vlcMediaPlayer.media != nil {
|
||||||
viewModelListeners.forEach { $0.cancel() }
|
viewModelListeners.forEach({ $0.cancel() })
|
||||||
|
|
||||||
vlcMediaPlayer.stop()
|
vlcMediaPlayer.stop()
|
||||||
viewModel.sendStopReport()
|
viewModel.sendStopReport()
|
||||||
|
@ -407,14 +407,13 @@ extension VLCPlayerViewController {
|
||||||
vlcMediaPlayer.delegate = self
|
vlcMediaPlayer.delegate = self
|
||||||
vlcMediaPlayer.drawable = videoContentView
|
vlcMediaPlayer.drawable = videoContentView
|
||||||
|
|
||||||
// TODO: Custom subtitle sizes
|
vlcMediaPlayer.setSubtitleSize(Defaults[.subtitleSize])
|
||||||
vlcMediaPlayer.perform(Selector(("setTextRendererFontSize:")), with: 16)
|
|
||||||
|
|
||||||
stopOverlayDismissTimer()
|
stopOverlayDismissTimer()
|
||||||
|
|
||||||
// Stop current media if there is one
|
// Stop current media if there is one
|
||||||
if vlcMediaPlayer.media != nil {
|
if vlcMediaPlayer.media != nil {
|
||||||
viewModelListeners.forEach { $0.cancel() }
|
viewModelListeners.forEach({ $0.cancel() })
|
||||||
|
|
||||||
vlcMediaPlayer.stop()
|
vlcMediaPlayer.stop()
|
||||||
viewModel.sendStopReport()
|
viewModel.sendStopReport()
|
||||||
|
@ -456,7 +455,6 @@ extension VLCPlayerViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: startPlayback
|
// MARK: startPlayback
|
||||||
|
|
||||||
func startPlayback() {
|
func startPlayback() {
|
||||||
vlcMediaPlayer.play()
|
vlcMediaPlayer.play()
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,11 @@
|
||||||
53EE24E6265060780068F029 /* LibrarySearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EE24E5265060780068F029 /* LibrarySearchView.swift */; };
|
53EE24E6265060780068F029 /* LibrarySearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EE24E5265060780068F029 /* LibrarySearchView.swift */; };
|
||||||
53F866442687A45F00DCD1D7 /* PortraitItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53F866432687A45F00DCD1D7 /* PortraitItemView.swift */; };
|
53F866442687A45F00DCD1D7 /* PortraitItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53F866432687A45F00DCD1D7 /* PortraitItemView.swift */; };
|
||||||
53FF7F2A263CF3F500585C35 /* LatestMediaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53FF7F29263CF3F500585C35 /* LatestMediaView.swift */; };
|
53FF7F2A263CF3F500585C35 /* LatestMediaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53FF7F29263CF3F500585C35 /* LatestMediaView.swift */; };
|
||||||
|
5D1603FC278A3D5800D22B99 /* SubtitleSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1603FB278A3D5700D22B99 /* SubtitleSize.swift */; };
|
||||||
|
5D1603FD278A40DB00D22B99 /* SubtitleSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1603FB278A3D5700D22B99 /* SubtitleSize.swift */; };
|
||||||
|
5D1603FE278A40DC00D22B99 /* SubtitleSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1603FB278A3D5700D22B99 /* SubtitleSize.swift */; };
|
||||||
|
5D160403278A41FD00D22B99 /* VLCPlayer+subtitles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D160402278A41FD00D22B99 /* VLCPlayer+subtitles.swift */; };
|
||||||
|
5D32EA12278C95E30020E292 /* VLCPlayer+subtitles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D160402278A41FD00D22B99 /* VLCPlayer+subtitles.swift */; };
|
||||||
5D64683D277B1649009E09AE /* PreferenceUIHostingSwizzling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D64683C277B1649009E09AE /* PreferenceUIHostingSwizzling.swift */; };
|
5D64683D277B1649009E09AE /* PreferenceUIHostingSwizzling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D64683C277B1649009E09AE /* PreferenceUIHostingSwizzling.swift */; };
|
||||||
62133890265F83A900A81A2A /* LibraryListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6213388F265F83A900A81A2A /* LibraryListView.swift */; };
|
62133890265F83A900A81A2A /* LibraryListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6213388F265F83A900A81A2A /* LibraryListView.swift */; };
|
||||||
621338932660107500A81A2A /* StringExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621338922660107500A81A2A /* StringExtensions.swift */; };
|
621338932660107500A81A2A /* StringExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621338922660107500A81A2A /* StringExtensions.swift */; };
|
||||||
|
@ -572,6 +577,8 @@
|
||||||
53EE24E5265060780068F029 /* LibrarySearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibrarySearchView.swift; sourceTree = "<group>"; };
|
53EE24E5265060780068F029 /* LibrarySearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibrarySearchView.swift; sourceTree = "<group>"; };
|
||||||
53F866432687A45F00DCD1D7 /* PortraitItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PortraitItemView.swift; sourceTree = "<group>"; };
|
53F866432687A45F00DCD1D7 /* PortraitItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PortraitItemView.swift; sourceTree = "<group>"; };
|
||||||
53FF7F29263CF3F500585C35 /* LatestMediaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LatestMediaView.swift; sourceTree = "<group>"; };
|
53FF7F29263CF3F500585C35 /* LatestMediaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LatestMediaView.swift; sourceTree = "<group>"; };
|
||||||
|
5D1603FB278A3D5700D22B99 /* SubtitleSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubtitleSize.swift; sourceTree = "<group>"; };
|
||||||
|
5D160402278A41FD00D22B99 /* VLCPlayer+subtitles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VLCPlayer+subtitles.swift"; sourceTree = "<group>"; };
|
||||||
5D64683C277B1649009E09AE /* PreferenceUIHostingSwizzling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferenceUIHostingSwizzling.swift; sourceTree = "<group>"; };
|
5D64683C277B1649009E09AE /* PreferenceUIHostingSwizzling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferenceUIHostingSwizzling.swift; sourceTree = "<group>"; };
|
||||||
6213388F265F83A900A81A2A /* LibraryListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryListView.swift; sourceTree = "<group>"; };
|
6213388F265F83A900A81A2A /* LibraryListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryListView.swift; sourceTree = "<group>"; };
|
||||||
621338922660107500A81A2A /* StringExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExtensions.swift; sourceTree = "<group>"; };
|
621338922660107500A81A2A /* StringExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExtensions.swift; sourceTree = "<group>"; };
|
||||||
|
@ -977,6 +984,7 @@
|
||||||
E1C812B4277A8E5D00918266 /* PlaybackSpeed.swift */,
|
E1C812B4277A8E5D00918266 /* PlaybackSpeed.swift */,
|
||||||
E193D4D727193CAC00900D82 /* PortraitImageStackable.swift */,
|
E193D4D727193CAC00900D82 /* PortraitImageStackable.swift */,
|
||||||
E10D87DD278510E300BD264C /* PosterSize.swift */,
|
E10D87DD278510E300BD264C /* PosterSize.swift */,
|
||||||
|
5D1603FB278A3D5700D22B99 /* SubtitleSize.swift */,
|
||||||
E1D4BF832719D25A00A11E64 /* TrackLanguage.swift */,
|
E1D4BF832719D25A00A11E64 /* TrackLanguage.swift */,
|
||||||
535870AC2669D8DD00D05A09 /* Typings.swift */,
|
535870AC2669D8DD00D05A09 /* Typings.swift */,
|
||||||
E1F0204D26CCCA74001C1C3B /* VideoPlayerJumpLength.swift */,
|
E1F0204D26CCCA74001C1C3B /* VideoPlayerJumpLength.swift */,
|
||||||
|
@ -1035,6 +1043,7 @@
|
||||||
62ECA01926FA6D6900E8EBB7 /* AppURLHandler */,
|
62ECA01926FA6D6900E8EBB7 /* AppURLHandler */,
|
||||||
5377CBF8263B596B003A4E83 /* Assets.xcassets */,
|
5377CBF8263B596B003A4E83 /* Assets.xcassets */,
|
||||||
53F866422687A45400DCD1D7 /* Components */,
|
53F866422687A45400DCD1D7 /* Components */,
|
||||||
|
5D160401278A41BA00D22B99 /* Extensions */,
|
||||||
5377CC02263B596B003A4E83 /* Info.plist */,
|
5377CC02263B596B003A4E83 /* Info.plist */,
|
||||||
E13D02842788B634000FCB04 /* Swiftfin.entitlements */,
|
E13D02842788B634000FCB04 /* Swiftfin.entitlements */,
|
||||||
5377CBFA263B596B003A4E83 /* Preview Content */,
|
5377CBFA263B596B003A4E83 /* Preview Content */,
|
||||||
|
@ -1215,6 +1224,13 @@
|
||||||
path = Components;
|
path = Components;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
5D160401278A41BA00D22B99 /* Extensions */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
);
|
||||||
|
path = Extensions;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
5D64683B277B15E4009E09AE /* PreferenceUIHosting */ = {
|
5D64683B277B15E4009E09AE /* PreferenceUIHosting */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
@ -1238,6 +1254,7 @@
|
||||||
E13DD3C727164B1E009D4DAF /* UIDeviceExtensions.swift */,
|
E13DD3C727164B1E009D4DAF /* UIDeviceExtensions.swift */,
|
||||||
E1C812C4277A90B200918266 /* URLComponentsExtensions.swift */,
|
E1C812C4277A90B200918266 /* URLComponentsExtensions.swift */,
|
||||||
62E1DCC2273CE19800C9AE76 /* URLExtensions.swift */,
|
62E1DCC2273CE19800C9AE76 /* URLExtensions.swift */,
|
||||||
|
5D160402278A41FD00D22B99 /* VLCPlayer+subtitles.swift */,
|
||||||
6220D0AC26D5EABB00B8E046 /* ViewExtensions.swift */,
|
6220D0AC26D5EABB00B8E046 /* ViewExtensions.swift */,
|
||||||
);
|
);
|
||||||
path = Extensions;
|
path = Extensions;
|
||||||
|
@ -1665,6 +1682,7 @@
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
3D0F2756C71CDF6B9EEBD4E0 /* [CP] Check Pods Manifest.lock */,
|
3D0F2756C71CDF6B9EEBD4E0 /* [CP] Check Pods Manifest.lock */,
|
||||||
6286F0A3271C0ABA00C40ED5 /* R.swift */,
|
6286F0A3271C0ABA00C40ED5 /* R.swift */,
|
||||||
|
C6EE6AB295A273FF14E6EF56 /* [CP] Prepare Artifacts */,
|
||||||
5358705C2669D21600D05A09 /* Sources */,
|
5358705C2669D21600D05A09 /* Sources */,
|
||||||
5358705D2669D21600D05A09 /* Frameworks */,
|
5358705D2669D21600D05A09 /* Frameworks */,
|
||||||
5358705E2669D21600D05A09 /* Resources */,
|
5358705E2669D21600D05A09 /* Resources */,
|
||||||
|
@ -2023,6 +2041,23 @@
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Swiftfin iOS/Pods-Swiftfin iOS-frameworks.sh\"\n";
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Swiftfin iOS/Pods-Swiftfin iOS-frameworks.sh\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
|
C6EE6AB295A273FF14E6EF56 /* [CP] Prepare Artifacts */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Swiftfin tvOS/Pods-Swiftfin tvOS-artifacts-${CONFIGURATION}-input-files.xcfilelist",
|
||||||
|
);
|
||||||
|
name = "[CP] Prepare Artifacts";
|
||||||
|
outputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Swiftfin tvOS/Pods-Swiftfin tvOS-artifacts-${CONFIGURATION}-output-files.xcfilelist",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Swiftfin tvOS/Pods-Swiftfin tvOS-artifacts.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
D4D3981ADF75BCD341D590C0 /* [CP] Check Pods Manifest.lock */ = {
|
D4D3981ADF75BCD341D590C0 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
|
@ -2086,6 +2121,7 @@
|
||||||
E13DD3F027178F87009D4DAF /* SwiftfinNotificationCenter.swift in Sources */,
|
E13DD3F027178F87009D4DAF /* SwiftfinNotificationCenter.swift in Sources */,
|
||||||
531690E7267ABD79005D8AB9 /* HomeView.swift in Sources */,
|
531690E7267ABD79005D8AB9 /* HomeView.swift in Sources */,
|
||||||
E11D224327378428003F9CB3 /* ServerDetailCoordinator.swift in Sources */,
|
E11D224327378428003F9CB3 /* ServerDetailCoordinator.swift in Sources */,
|
||||||
|
5D32EA12278C95E30020E292 /* VLCPlayer+subtitles.swift in Sources */,
|
||||||
E1D4BF8B2719D3D000A11E64 /* BasicAppSettingsCoordinator.swift in Sources */,
|
E1D4BF8B2719D3D000A11E64 /* BasicAppSettingsCoordinator.swift in Sources */,
|
||||||
E1E5D53B2783A80900692DFE /* CinematicItemViewTopRow.swift in Sources */,
|
E1E5D53B2783A80900692DFE /* CinematicItemViewTopRow.swift in Sources */,
|
||||||
E13DD3FA2717E961009D4DAF /* UserListViewModel.swift in Sources */,
|
E13DD3FA2717E961009D4DAF /* UserListViewModel.swift in Sources */,
|
||||||
|
@ -2163,6 +2199,7 @@
|
||||||
E1AD104E26D96CE3003E4A08 /* BaseItemDtoExtensions.swift in Sources */,
|
E1AD104E26D96CE3003E4A08 /* BaseItemDtoExtensions.swift in Sources */,
|
||||||
62E632DD267D2E130063E547 /* LibrarySearchViewModel.swift in Sources */,
|
62E632DD267D2E130063E547 /* LibrarySearchViewModel.swift in Sources */,
|
||||||
536D3D81267BDFC60004248C /* PortraitItemElement.swift in Sources */,
|
536D3D81267BDFC60004248C /* PortraitItemElement.swift in Sources */,
|
||||||
|
5D1603FD278A40DB00D22B99 /* SubtitleSize.swift in Sources */,
|
||||||
E1AA33232782648000F6439C /* OverlaySliderColor.swift in Sources */,
|
E1AA33232782648000F6439C /* OverlaySliderColor.swift in Sources */,
|
||||||
E103A6A7278AB6D700820EC7 /* CinematicResumeCardView.swift in Sources */,
|
E103A6A7278AB6D700820EC7 /* CinematicResumeCardView.swift in Sources */,
|
||||||
62E1DCC4273CE19800C9AE76 /* URLExtensions.swift in Sources */,
|
62E1DCC4273CE19800C9AE76 /* URLExtensions.swift in Sources */,
|
||||||
|
@ -2272,6 +2309,7 @@
|
||||||
E13DD3EC27178A54009D4DAF /* UserSignInViewModel.swift in Sources */,
|
E13DD3EC27178A54009D4DAF /* UserSignInViewModel.swift in Sources */,
|
||||||
625CB5772678C34300530A6E /* ConnectToServerViewModel.swift in Sources */,
|
625CB5772678C34300530A6E /* ConnectToServerViewModel.swift in Sources */,
|
||||||
C4BE07852728446F003F4AD1 /* LiveTVChannelsViewModel.swift in Sources */,
|
C4BE07852728446F003F4AD1 /* LiveTVChannelsViewModel.swift in Sources */,
|
||||||
|
5D160403278A41FD00D22B99 /* VLCPlayer+subtitles.swift in Sources */,
|
||||||
536D3D78267BD5C30004248C /* ViewModel.swift in Sources */,
|
536D3D78267BD5C30004248C /* ViewModel.swift in Sources */,
|
||||||
C4BE078B272844AF003F4AD1 /* LiveTVChannelsView.swift in Sources */,
|
C4BE078B272844AF003F4AD1 /* LiveTVChannelsView.swift in Sources */,
|
||||||
E1FCD08826C35A0D007C8DCF /* NetworkError.swift in Sources */,
|
E1FCD08826C35A0D007C8DCF /* NetworkError.swift in Sources */,
|
||||||
|
@ -2312,6 +2350,7 @@
|
||||||
091B5A8B2683142E00D78B61 /* UDPBroadCastConnection.swift in Sources */,
|
091B5A8B2683142E00D78B61 /* UDPBroadCastConnection.swift in Sources */,
|
||||||
6267B3D626710B8900A7371D /* CollectionExtensions.swift in Sources */,
|
6267B3D626710B8900A7371D /* CollectionExtensions.swift in Sources */,
|
||||||
E13DD3F5271793BB009D4DAF /* UserSignInView.swift in Sources */,
|
E13DD3F5271793BB009D4DAF /* UserSignInView.swift in Sources */,
|
||||||
|
5D1603FC278A3D5800D22B99 /* SubtitleSize.swift in Sources */,
|
||||||
E1F0204E26CCCA74001C1C3B /* VideoPlayerJumpLength.swift in Sources */,
|
E1F0204E26CCCA74001C1C3B /* VideoPlayerJumpLength.swift in Sources */,
|
||||||
53649AB1269CFB1900A2D8B7 /* LogManager.swift in Sources */,
|
53649AB1269CFB1900A2D8B7 /* LogManager.swift in Sources */,
|
||||||
E13DD3E127176BD3009D4DAF /* ServerListViewModel.swift in Sources */,
|
E13DD3E127176BD3009D4DAF /* ServerListViewModel.swift in Sources */,
|
||||||
|
@ -2426,6 +2465,7 @@
|
||||||
62E1DCC5273CE19800C9AE76 /* URLExtensions.swift in Sources */,
|
62E1DCC5273CE19800C9AE76 /* URLExtensions.swift in Sources */,
|
||||||
62EC353226766849000E9F2D /* SessionManager.swift in Sources */,
|
62EC353226766849000E9F2D /* SessionManager.swift in Sources */,
|
||||||
536D3D79267BD5D00004248C /* ViewModel.swift in Sources */,
|
536D3D79267BD5D00004248C /* ViewModel.swift in Sources */,
|
||||||
|
5D1603FE278A40DC00D22B99 /* SubtitleSize.swift in Sources */,
|
||||||
E1AA332427829B5200F6439C /* OverlayType.swift in Sources */,
|
E1AA332427829B5200F6439C /* OverlayType.swift in Sources */,
|
||||||
E1D4BF8C2719F39F00A11E64 /* AppAppearance.swift in Sources */,
|
E1D4BF8C2719F39F00A11E64 /* AppAppearance.swift in Sources */,
|
||||||
);
|
);
|
||||||
|
|
|
@ -13,37 +13,23 @@ import SwiftUI
|
||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
|
|
||||||
@EnvironmentObject
|
@EnvironmentObject var settingsRouter: SettingsCoordinator.Router
|
||||||
var settingsRouter: SettingsCoordinator.Router
|
@ObservedObject var viewModel: SettingsViewModel
|
||||||
@ObservedObject
|
|
||||||
var viewModel: SettingsViewModel
|
|
||||||
|
|
||||||
@Default(.inNetworkBandwidth)
|
@Default(.inNetworkBandwidth) var inNetworkStreamBitrate
|
||||||
var inNetworkStreamBitrate
|
@Default(.outOfNetworkBandwidth) var outOfNetworkStreamBitrate
|
||||||
@Default(.outOfNetworkBandwidth)
|
@Default(.isAutoSelectSubtitles) var isAutoSelectSubtitles
|
||||||
var outOfNetworkStreamBitrate
|
@Default(.autoSelectSubtitlesLangCode) var autoSelectSubtitlesLangcode
|
||||||
@Default(.isAutoSelectSubtitles)
|
@Default(.autoSelectAudioLangCode) var autoSelectAudioLangcode
|
||||||
var isAutoSelectSubtitles
|
@Default(.appAppearance) var appAppearance
|
||||||
@Default(.autoSelectSubtitlesLangCode)
|
@Default(.overlayType) var overlayType
|
||||||
var autoSelectSubtitlesLangcode
|
@Default(.videoPlayerJumpForward) var jumpForwardLength
|
||||||
@Default(.autoSelectAudioLangCode)
|
@Default(.videoPlayerJumpBackward) var jumpBackwardLength
|
||||||
var autoSelectAudioLangcode
|
@Default(.jumpGesturesEnabled) var jumpGesturesEnabled
|
||||||
@Default(.appAppearance)
|
@Default(.showPosterLabels) var showPosterLabels
|
||||||
var appAppearance
|
@Default(.showCastAndCrew) var showCastAndCrew
|
||||||
@Default(.overlayType)
|
@Default(.resumeOffset) var resumeOffset
|
||||||
var overlayType
|
@Default(.subtitleSize) var subtitleSize
|
||||||
@Default(.videoPlayerJumpForward)
|
|
||||||
var jumpForwardLength
|
|
||||||
@Default(.videoPlayerJumpBackward)
|
|
||||||
var jumpBackwardLength
|
|
||||||
@Default(.jumpGesturesEnabled)
|
|
||||||
var jumpGesturesEnabled
|
|
||||||
@Default(.showPosterLabels)
|
|
||||||
var showPosterLabels
|
|
||||||
@Default(.showCastAndCrew)
|
|
||||||
var showCastAndCrew
|
|
||||||
@Default(.resumeOffset)
|
|
||||||
var resumeOffset
|
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Form {
|
Form {
|
||||||
|
@ -144,6 +130,11 @@ struct SettingsView: View {
|
||||||
Text(appearance.localizedName).tag(appearance.rawValue)
|
Text(appearance.localizedName).tag(appearance.rawValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Picker("Subtitle size", selection: $subtitleSize) {
|
||||||
|
ForEach(SubtitleSize.allCases, id: \.self) { size in
|
||||||
|
Text(size.label).tag(size.rawValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationBarTitle("Settings", displayMode: .inline)
|
.navigationBarTitle("Settings", displayMode: .inline)
|
||||||
|
|
|
@ -293,7 +293,7 @@ extension VLCPlayerViewController {
|
||||||
// remove old player
|
// remove old player
|
||||||
|
|
||||||
if vlcMediaPlayer.media != nil {
|
if vlcMediaPlayer.media != nil {
|
||||||
viewModelListeners.forEach { $0.cancel() }
|
viewModelListeners.forEach({ $0.cancel() })
|
||||||
|
|
||||||
vlcMediaPlayer.stop()
|
vlcMediaPlayer.stop()
|
||||||
viewModel.sendStopReport()
|
viewModel.sendStopReport()
|
||||||
|
@ -309,8 +309,7 @@ extension VLCPlayerViewController {
|
||||||
vlcMediaPlayer.delegate = self
|
vlcMediaPlayer.delegate = self
|
||||||
vlcMediaPlayer.drawable = videoContentView
|
vlcMediaPlayer.drawable = videoContentView
|
||||||
|
|
||||||
// TODO: Custom subtitle sizes
|
vlcMediaPlayer.setSubtitleSize(Defaults[.subtitleSize])
|
||||||
vlcMediaPlayer.perform(Selector(("setTextRendererFontSize:")), with: 14)
|
|
||||||
|
|
||||||
stopOverlayDismissTimer()
|
stopOverlayDismissTimer()
|
||||||
|
|
||||||
|
@ -347,7 +346,6 @@ extension VLCPlayerViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: startPlayback
|
// MARK: startPlayback
|
||||||
|
|
||||||
func startPlayback() {
|
func startPlayback() {
|
||||||
vlcMediaPlayer.play()
|
vlcMediaPlayer.play()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue