1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30

Close item if could not be opened

This commit is contained in:
Arkadiusz Fal 2022-11-12 01:40:55 +01:00
parent ebc9ea0031
commit 2c004b81fe
2 changed files with 2 additions and 0 deletions

View File

@ -133,6 +133,7 @@ final class AVPlayerBackend: PlayerBackend {
if video.isLocal, video.localStreamIsFile, let localURL = video.localStream?.localURL {
guard localURL.startAccessingSecurityScopedResource() else {
model.navigation.presentAlert(title: "Could not open file")
model.closeCurrentItem()
return
}
url = localURL

View File

@ -293,6 +293,7 @@ final class MPVBackend: PlayerBackend {
if video.isLocal, video.localStreamIsFile, let localStream = video.localStream {
guard localStream.localURL.startAccessingSecurityScopedResource() else {
self.model.navigation.presentAlert(title: "Could not open file")
self.model.closeCurrentItem()
return
}
}