episode/movie cinematic view toggle
This commit is contained in:
parent
25b4e382f2
commit
e21aa66372
|
@ -63,6 +63,7 @@ struct EpisodesRowView: View {
|
||||||
.padding(.horizontal, 50)
|
.padding(.horizontal, 50)
|
||||||
.padding(.vertical)
|
.padding(.vertical)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
// TODO: Get this working
|
||||||
reader.scrollTo(viewModel.item.name)
|
reader.scrollTo(viewModel.item.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import SwiftUI
|
import Defaults
|
||||||
import Introspect
|
import Introspect
|
||||||
import JellyfinAPI
|
import JellyfinAPI
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
// Useless view necessary in tvOS because of iOS's implementation
|
// Useless view necessary in tvOS because of iOS's implementation
|
||||||
struct ItemNavigationView: View {
|
struct ItemNavigationView: View {
|
||||||
|
@ -23,6 +24,10 @@ struct ItemNavigationView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ItemView: View {
|
struct ItemView: View {
|
||||||
|
|
||||||
|
@Default(.tvOSEpisodeItemCinematicView) var tvOSEpisodeItemCinematicView
|
||||||
|
@Default(.tvOSMovieItemCinematicView) var tvOSMovieItemCinematicView
|
||||||
|
|
||||||
private var item: BaseItemDto
|
private var item: BaseItemDto
|
||||||
|
|
||||||
init(item: BaseItemDto) {
|
init(item: BaseItemDto) {
|
||||||
|
@ -32,13 +37,21 @@ struct ItemView: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Group {
|
Group {
|
||||||
if item.type == "Movie" {
|
if item.type == "Movie" {
|
||||||
CinematicMovieItemView(viewModel: MovieItemViewModel(item: item))
|
if tvOSMovieItemCinematicView {
|
||||||
|
CinematicMovieItemView(viewModel: MovieItemViewModel(item: item))
|
||||||
|
} else {
|
||||||
|
MovieItemView(viewModel: MovieItemViewModel(item: item))
|
||||||
|
}
|
||||||
} else if item.type == "Series" {
|
} else if item.type == "Series" {
|
||||||
SeriesItemView(viewModel: .init(item: item))
|
SeriesItemView(viewModel: .init(item: item))
|
||||||
} else if item.type == "Season" {
|
} else if item.type == "Season" {
|
||||||
SeasonItemView(viewModel: .init(item: item))
|
SeasonItemView(viewModel: .init(item: item))
|
||||||
} else if item.type == "Episode" {
|
} else if item.type == "Episode" {
|
||||||
CinematicEpisodeItemView(viewModel: EpisodeItemViewModel(item: item))
|
if tvOSEpisodeItemCinematicView {
|
||||||
|
CinematicEpisodeItemView(viewModel: EpisodeItemViewModel(item: item))
|
||||||
|
} else {
|
||||||
|
EpisodeItemView(viewModel: EpisodeItemViewModel(item: item))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Text(L10n.notImplementedYetWithType(item.type ?? ""))
|
Text(L10n.notImplementedYetWithType(item.type ?? ""))
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@ struct SettingsView: View {
|
||||||
@Default(.videoPlayerJumpBackward) var jumpBackwardLength
|
@Default(.videoPlayerJumpBackward) var jumpBackwardLength
|
||||||
@Default(.downActionShowsMenu) var downActionShowsMenu
|
@Default(.downActionShowsMenu) var downActionShowsMenu
|
||||||
@Default(.confirmClose) var confirmClose
|
@Default(.confirmClose) var confirmClose
|
||||||
|
@Default(.tvOSEpisodeItemCinematicView) var tvOSEpisodeItemCinematicView
|
||||||
|
@Default(.tvOSMovieItemCinematicView) var tvOSMovieItemCinematicView
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
GeometryReader { reader in
|
GeometryReader { reader in
|
||||||
|
@ -37,6 +39,7 @@ struct SettingsView: View {
|
||||||
Text(viewModel.user.username)
|
Text(viewModel.user.username)
|
||||||
.foregroundColor(.jellyfinPurple)
|
.foregroundColor(.jellyfinPurple)
|
||||||
}
|
}
|
||||||
|
.focusable()
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
settingsRouter.route(to: \.serverDetail)
|
settingsRouter.route(to: \.serverDetail)
|
||||||
|
@ -101,6 +104,13 @@ struct SettingsView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
Toggle("Episode Item Cinematic View", isOn: $tvOSEpisodeItemCinematicView)
|
||||||
|
Toggle("Movie Item Cinematic View", isOn: $tvOSMovieItemCinematicView)
|
||||||
|
} header: {
|
||||||
|
Text("Views")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,7 @@ class VLCPlayerViewController: UIViewController {
|
||||||
guard let buttonPress = presses.first?.type else { return }
|
guard let buttonPress = presses.first?.type else { return }
|
||||||
|
|
||||||
switch(buttonPress) {
|
switch(buttonPress) {
|
||||||
case .menu: () // Captured by other gesture
|
case .menu: () // Captured by other recognizer
|
||||||
case .playPause:
|
case .playPause:
|
||||||
hideConfirmCloseOverlay()
|
hideConfirmCloseOverlay()
|
||||||
|
|
||||||
|
@ -207,13 +207,6 @@ class VLCPlayerViewController: UIViewController {
|
||||||
didGenerallyTap()
|
didGenerallyTap()
|
||||||
case .upArrow:
|
case .upArrow:
|
||||||
hideConfirmCloseOverlay()
|
hideConfirmCloseOverlay()
|
||||||
|
|
||||||
if displayingContentOverlay {
|
|
||||||
hideOverlayContent()
|
|
||||||
|
|
||||||
showOverlay()
|
|
||||||
restartOverlayDismissTimer()
|
|
||||||
}
|
|
||||||
case .downArrow:
|
case .downArrow:
|
||||||
hideConfirmCloseOverlay()
|
hideConfirmCloseOverlay()
|
||||||
|
|
||||||
|
@ -776,6 +769,8 @@ extension VLCPlayerViewController: PlayerOverlayDelegate {
|
||||||
case .playing:
|
case .playing:
|
||||||
viewModel.sendPauseReport(paused: true)
|
viewModel.sendPauseReport(paused: true)
|
||||||
vlcMediaPlayer.pause()
|
vlcMediaPlayer.pause()
|
||||||
|
|
||||||
|
showOverlay()
|
||||||
restartOverlayDismissTimer(interval: 5)
|
restartOverlayDismissTimer(interval: 5)
|
||||||
case .paused:
|
case .paused:
|
||||||
viewModel.sendPauseReport(paused: false)
|
viewModel.sendPauseReport(paused: false)
|
||||||
|
|
|
@ -32,6 +32,7 @@ struct SliderView: UIViewRepresentable {
|
||||||
slider.minimumTrackTintColor = .white
|
slider.minimumTrackTintColor = .white
|
||||||
slider.focusScaleFactor = 1.4
|
slider.focusScaleFactor = 1.4
|
||||||
slider.panDampingValue = 50
|
slider.panDampingValue = 50
|
||||||
|
slider.fineTunningVelocityThreshold = 1000
|
||||||
|
|
||||||
return slider
|
return slider
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,6 @@ private let defaultFocusScaleFactor: CGFloat = 1.05
|
||||||
private let defaultStepValue: Float = 0.1
|
private let defaultStepValue: Float = 0.1
|
||||||
private let decelerationRate: Float = 0.92
|
private let decelerationRate: Float = 0.92
|
||||||
private let decelerationMaxVelocity: Float = 1000
|
private let decelerationMaxVelocity: Float = 1000
|
||||||
private let fineTunningVelocityThreshold: Float = 600
|
|
||||||
|
|
||||||
/// A control used to select a single value from a continuous range of values.
|
/// A control used to select a single value from a continuous range of values.
|
||||||
public final class TvOSSlider: UIControl {
|
public final class TvOSSlider: UIControl {
|
||||||
|
@ -117,6 +116,8 @@ public final class TvOSSlider: UIControl {
|
||||||
// Size for thumb view
|
// Size for thumb view
|
||||||
public var thumbSize: CGFloat = 30
|
public var thumbSize: CGFloat = 30
|
||||||
|
|
||||||
|
public var fineTunningVelocityThreshold: Float = 600
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the slider’s current value, allowing you to animate the change visually.
|
Sets the slider’s current value, allowing you to animate the change visually.
|
||||||
|
|
||||||
|
|
|
@ -60,4 +60,6 @@ extension Defaults.Keys {
|
||||||
// tvos specific
|
// tvos specific
|
||||||
static let downActionShowsMenu = Key<Bool>("downActionShowsMenu", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
static let downActionShowsMenu = Key<Bool>("downActionShowsMenu", default: true, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
static let confirmClose = Key<Bool>("confirmClose", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
static let confirmClose = Key<Bool>("confirmClose", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
|
static let tvOSEpisodeItemCinematicView = Key<Bool>("tvOSEpisodeItemCinematicView", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
|
static let tvOSMovieItemCinematicView = Key<Bool>("tvOSMovieItemCinematicView", default: false, suite: SwiftfinStore.Defaults.generalSuite)
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,8 @@ final class ConnectToServerViewModel: ViewModel {
|
||||||
uri = "http://localhost:8096"
|
uri = "http://localhost:8096"
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
let uri = uri.trimmingCharacters(in: .whitespaces)
|
||||||
|
|
||||||
LogManager.shared.log.debug("Attempting to connect to server at \"\(uri)\"", tag: "connectToServer")
|
LogManager.shared.log.debug("Attempting to connect to server at \"\(uri)\"", tag: "connectToServer")
|
||||||
SessionManager.main.connectToServer(with: uri)
|
SessionManager.main.connectToServer(with: uri)
|
||||||
|
|
Loading…
Reference in New Issue