video: switch videoplayer to use detached tasks

This commit is contained in:
William Casarin
2023-06-20 15:56:55 +02:00
parent b7b7d65612
commit 2ff12cdfa6
3 changed files with 12 additions and 13 deletions

View File

@@ -204,6 +204,7 @@ class EventCache {
return image_metadata[url.absoluteString.lowercased()]
}
@MainActor
func lookup_media_size(url: URL) -> CGSize? {
if let img_meta = lookup_img_metadata(url: url) {
return img_meta.meta.dim?.size
@@ -216,6 +217,7 @@ class EventCache {
video_meta[url.absoluteString] = meta
}
@MainActor
func get_video_player_model(url: URL) -> VideoPlayerModel {
if let model = video_meta[url.absoluteString] {
return model