Fix closing video on error

This commit is contained in:
Arkadiusz Fal 2023-05-26 23:20:45 +02:00
parent a054d343a9
commit 947f216fac
2 changed files with 2 additions and 4 deletions

View File

@ -626,6 +626,7 @@ final class PlayerModel: ObservableObject {
func closeCurrentItem(finished: Bool = false) { func closeCurrentItem(finished: Bool = false) {
pause() pause()
videoBeingOpened = nil videoBeingOpened = nil
advancing = false
forceBackendOnPlay = nil forceBackendOnPlay = nil
closing = true closing = true

View File

@ -364,10 +364,7 @@ extension PlayerModel {
message: Text(message), message: Text(message),
primaryButton: .cancel { [weak self] in primaryButton: .cancel { [weak self] in
guard let self else { return } guard let self else { return }
self.advancing = false self.closeCurrentItem()
self.videoBeingOpened = nil
self.currentItem = nil
self.hide()
}, },
secondaryButton: retryButton secondaryButton: retryButton
) )