Video details changes and channel sheet

This commit is contained in:
Arkadiusz Fal
2023-04-22 10:56:42 +02:00
parent 5db74a3997
commit 67690bc435
15 changed files with 389 additions and 256 deletions

View File

@@ -335,6 +335,7 @@ final class PlayerModel: ObservableObject {
videoBeingOpened = video
WatchNextViewModel.shared.hide()
navigation.presentingChannelSheet = false
var changeBackendHandler: (() -> Void)?

View File

@@ -15,6 +15,8 @@ extension PlayerModel {
func play(_ videos: [Video], shuffling: Bool = false) {
WatchNextViewModel.shared.hide()
navigation.presentingChannelSheet = false
playbackMode = shuffling ? .shuffle : .queue
videos.forEach { enqueueVideo($0, loadDetails: false) }
@@ -33,6 +35,8 @@ extension PlayerModel {
}
func playNow(_ video: Video, at time: CMTime? = nil) {
navigation.presentingChannelSheet = false
if playingInPictureInPicture, closePiPOnNavigation {
closePiP()
}
@@ -56,6 +60,7 @@ extension PlayerModel {
comments.reset()
stream = nil
WatchNextViewModel.shared.hide()
navigation.presentingChannelSheet = false
withAnimation {
aspectRatio = VideoPlayerView.defaultAspectRatio
@@ -176,6 +181,7 @@ extension PlayerModel {
remove(newItem)
WatchNextViewModel.shared.hide()
navigation.presentingChannelSheet = false
currentItem = newItem
currentItem.playbackTime = time
@@ -219,9 +225,12 @@ extension PlayerModel {
let item = PlayerQueueItem(video, playbackTime: atTime)
if play {
navigation.presentingChannelSheet = false
withAnimation {
aspectRatio = VideoPlayerView.defaultAspectRatio
WatchNextViewModel.shared.hide()
navigation.presentingChannelSheet = false
currentItem = item
}
videoBeingOpened = video