mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Fix player initializer
This commit is contained in:
@@ -10,8 +10,6 @@ struct TVNavigationView: View {
|
||||
|
||||
@Default(.visibleSections) private var visibleSections
|
||||
|
||||
@State private var playerInitialized = false
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
TabView(selection: navigation.tabSelectionBinding) {
|
||||
@@ -58,7 +56,6 @@ struct TVNavigationView: View {
|
||||
.tag(TabSelection.settings)
|
||||
}
|
||||
}
|
||||
.background(videoPlayerInitialize)
|
||||
.fullScreenCover(isPresented: $navigation.presentingAddToPlaylist) {
|
||||
if let video = navigation.videoToAddToPlaylist {
|
||||
AddToPlaylistView(video: video)
|
||||
@@ -78,18 +75,6 @@ struct TVNavigationView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder var videoPlayerInitialize: some View {
|
||||
if !playerInitialized {
|
||||
VideoPlayerView()
|
||||
.scaleEffect(0.00001)
|
||||
.onAppear {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
playerInitialized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct TVNavigationView_Previews: PreviewProvider {
|
||||
|
Reference in New Issue
Block a user