mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 10:44:06 +00:00
Minor code style fixes, remove unneeded views
This commit is contained in:
@@ -3,7 +3,13 @@ import SwiftUI
|
||||
import Introspect
|
||||
#endif
|
||||
|
||||
typealias TabSelection = AppSidebarNavigation.TabSelection
|
||||
|
||||
struct AppSidebarNavigation: View {
|
||||
enum TabSelection: String {
|
||||
case subscriptions, popular, trending, playlists, channel, search
|
||||
}
|
||||
|
||||
@EnvironmentObject<NavigationState> private var navigationState
|
||||
|
||||
@State private var didApplyPrimaryViewWorkAround = false
|
||||
|
@@ -68,13 +68,9 @@ extension PlayerViewController: AVPlayerViewControllerDelegate {
|
||||
|
||||
func playerViewController(
|
||||
_: AVPlayerViewController,
|
||||
willBeginFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator
|
||||
willBeginFullScreenPresentationWithAnimationCoordinator _: UIViewControllerTransitionCoordinator
|
||||
) {
|
||||
coordinator.animate(alongsideTransition: nil) { context in
|
||||
if !context.isCancelled {
|
||||
self.playingFullScreen = true
|
||||
}
|
||||
}
|
||||
playingFullScreen = true
|
||||
}
|
||||
|
||||
func playerViewController(
|
||||
|
@@ -1,6 +0,0 @@
|
||||
import Defaults
|
||||
import Foundation
|
||||
|
||||
enum TabSelection: String, DefaultsSerializable {
|
||||
case subscriptions, popular, trending, playlists, channel, search
|
||||
}
|
@@ -13,37 +13,25 @@ struct VideoPlayerView: View {
|
||||
|
||||
var video: Video
|
||||
|
||||
var player: AVPlayer!
|
||||
|
||||
init(_ video: Video) {
|
||||
self.video = video
|
||||
resource.addObserver(store)
|
||||
|
||||
player = AVPlayer()
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
#if os(tvOS)
|
||||
if store.item == nil {
|
||||
VideoLoading(video: video)
|
||||
Player(video: video)
|
||||
.frame(alignment: .leading)
|
||||
|
||||
#if !os(tvOS)
|
||||
ScrollView(.vertical) {
|
||||
VStack(alignment: .leading) {
|
||||
Text(video.title)
|
||||
Text(video.author)
|
||||
}
|
||||
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
#endif
|
||||
|
||||
VStack {
|
||||
Player(video: video)
|
||||
.frame(alignment: .leading)
|
||||
|
||||
#if !os(tvOS)
|
||||
ScrollView(.vertical) {
|
||||
VStack(alignment: .leading) {
|
||||
Text(video.title)
|
||||
Text(video.author)
|
||||
}
|
||||
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
resource.loadIfNeeded()
|
||||
@@ -54,9 +42,7 @@ struct VideoPlayerView: View {
|
||||
|
||||
navigationState.showingVideoDetails = navigationState.returnToDetails
|
||||
}
|
||||
#if os(tvOS)
|
||||
.background(.thinMaterial)
|
||||
#elseif os(macOS)
|
||||
#if os(macOS)
|
||||
.navigationTitle(video.title)
|
||||
#elseif os(iOS)
|
||||
.navigationBarTitle(video.title, displayMode: .inline)
|
||||
|
Reference in New Issue
Block a user