Improve bookmarks loading

This commit is contained in:
Arkadiusz Fal
2022-11-12 03:05:56 +01:00
parent eb9924bd4a
commit ccded28468
2 changed files with 4 additions and 13 deletions

View File

@@ -130,13 +130,8 @@ final class AVPlayerBackend: PlayerBackend {
if var url = stream.singleAssetURL {
model.logger.info("playing stream with one asset\(stream.kind == .hls ? " (HLS)" : ""): \(url)")
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
if video.isLocal, video.localStreamIsFile {
_ = url.startAccessingSecurityScopedResource()
}
loadSingleAsset(url, stream: stream, of: video, preservingTime: preservingTime)