tvOS History improvements

This commit is contained in:
Arkadiusz Fal
2021-10-14 00:05:19 +02:00
parent 70c089e696
commit 2c275d9353
4 changed files with 42 additions and 9 deletions

View File

@@ -14,11 +14,7 @@ struct PlayerQueueRow: View {
player.addCurrentItemToHistory()
if history {
let newItem = player.enqueueVideo(item.video, prepending: true)
player.advanceToItem(newItem!)
if let historyItemIndex = player.history.firstIndex(of: item) {
player.history.remove(at: historyItemIndex)
}
player.playHistory(item)
} else {
player.advanceToItem(item)
}

View File

@@ -45,6 +45,7 @@ final class PlayerViewController: UIViewController {
let controller = UIHostingController(rootView:
AnyView(
NowPlayingView(infoViewController: true)
.frame(maxHeight: 600)
.environmentObject(playerModel)
)
)