Multiplatform playing first steps

This commit is contained in:
Arkadiusz Fal
2021-07-19 00:32:46 +02:00
parent 24a767e51c
commit fa07e47a22
19 changed files with 491 additions and 501 deletions

View File

@@ -8,9 +8,13 @@ final class NavigationState: ObservableObject {
@Published var channel: Channel?
@Published var showingVideoDetails = false
@Published var showingVideo = false
@Published var video: Video?
@Published var returnToDetails = false
func openChannel(_ channel: Channel) {
returnToDetails = false
self.channel = channel
showingChannel = true
}
@@ -30,6 +34,16 @@ final class NavigationState: ObservableObject {
video = nil
}
func playVideo(_ video: Video) {
self.video = video
showingVideo = true
}
func showVideoDetailsIfNeeded() {
showingVideoDetails = returnToDetails
returnToDetails = false
}
var tabSelectionOptionalBinding: Binding<TabSelection?> {
Binding<TabSelection?>(
get: {