From e00fd49d895bd918df1d1919e4ba493c17b0ecc9 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Sat, 20 Jan 2024 19:41:44 +0100 Subject: [PATCH] fix movie supported type --- .../Sources/StatusKit/Editor/Components/AccessoryView.swift | 2 +- .../Sources/StatusKit/Editor/Components/UTTypeSupported.swift | 3 +++ Packages/StatusKit/Sources/StatusKit/Editor/MainView.swift | 3 ++- Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Packages/StatusKit/Sources/StatusKit/Editor/Components/AccessoryView.swift b/Packages/StatusKit/Sources/StatusKit/Editor/Components/AccessoryView.swift index 739a0442..2294cc23 100644 --- a/Packages/StatusKit/Sources/StatusKit/Editor/Components/AccessoryView.swift +++ b/Packages/StatusKit/Sources/StatusKit/Editor/Components/AccessoryView.swift @@ -116,7 +116,7 @@ extension StatusEditor { matching: .any(of: [.images, .videos]), photoLibrary: .shared()) .fileImporter(isPresented: $isFileImporterPresented, - allowedContentTypes: [.image, .video], + allowedContentTypes: [.image, .video, .movie], allowsMultipleSelection: true) { result in if let urls = try? result.get() { diff --git a/Packages/StatusKit/Sources/StatusKit/Editor/Components/UTTypeSupported.swift b/Packages/StatusKit/Sources/StatusKit/Editor/Components/UTTypeSupported.swift index 9087cea3..d9b7f35d 100644 --- a/Packages/StatusKit/Sources/StatusKit/Editor/Components/UTTypeSupported.swift +++ b/Packages/StatusKit/Sources/StatusKit/Editor/Components/UTTypeSupported.swift @@ -88,6 +88,9 @@ extension StatusEditor { FileRepresentation(importedContentType: .movie) { receivedTransferrable in return MovieFileTranseferable(url: receivedTransferrable.localURL) } + FileRepresentation(importedContentType: .video) { receivedTransferrable in + return MovieFileTranseferable(url: receivedTransferrable.localURL) + } } } diff --git a/Packages/StatusKit/Sources/StatusKit/Editor/MainView.swift b/Packages/StatusKit/Sources/StatusKit/Editor/MainView.swift index 8c3b94e7..1dae9f34 100644 --- a/Packages/StatusKit/Sources/StatusKit/Editor/MainView.swift +++ b/Packages/StatusKit/Sources/StatusKit/Editor/MainView.swift @@ -125,7 +125,8 @@ extension StatusEditor { } } } - .onDrop(of: [.image, .video, .gif], delegate: focusedSEVM) + .onDrop(of: [.image, .video, .gif, .mpeg4Movie, .quickTimeMovie, .movie], + delegate: focusedSEVM) .onChange(of: currentAccount.account?.id) { mainSEVM.currentAccount = currentAccount.account for p in followUpSEVMs { diff --git a/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift b/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift index d1f2f7d7..829d55a4 100644 --- a/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift +++ b/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift @@ -899,7 +899,7 @@ extension StatusEditor { extension StatusEditor.ViewModel: DropDelegate { public func performDrop(info: DropInfo) -> Bool { - let item = info.itemProviders(for: [.image, .video, .gif]) + let item = info.itemProviders(for: [.image, .video, .gif, .mpeg4Movie, .quickTimeMovie, .movie]) processItemsProvider(items: item) return true }