fix movie supported type

This commit is contained in:
Thomas Ricouard 2024-01-20 19:41:44 +01:00
parent 97798b2c35
commit e00fd49d89
4 changed files with 7 additions and 3 deletions

View file

@ -116,7 +116,7 @@ extension StatusEditor {
matching: .any(of: [.images, .videos]), matching: .any(of: [.images, .videos]),
photoLibrary: .shared()) photoLibrary: .shared())
.fileImporter(isPresented: $isFileImporterPresented, .fileImporter(isPresented: $isFileImporterPresented,
allowedContentTypes: [.image, .video], allowedContentTypes: [.image, .video, .movie],
allowsMultipleSelection: true) allowsMultipleSelection: true)
{ result in { result in
if let urls = try? result.get() { if let urls = try? result.get() {

View file

@ -88,6 +88,9 @@ extension StatusEditor {
FileRepresentation(importedContentType: .movie) { receivedTransferrable in FileRepresentation(importedContentType: .movie) { receivedTransferrable in
return MovieFileTranseferable(url: receivedTransferrable.localURL) return MovieFileTranseferable(url: receivedTransferrable.localURL)
} }
FileRepresentation(importedContentType: .video) { receivedTransferrable in
return MovieFileTranseferable(url: receivedTransferrable.localURL)
}
} }
} }

View file

@ -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) { .onChange(of: currentAccount.account?.id) {
mainSEVM.currentAccount = currentAccount.account mainSEVM.currentAccount = currentAccount.account
for p in followUpSEVMs { for p in followUpSEVMs {

View file

@ -899,7 +899,7 @@ extension StatusEditor {
extension StatusEditor.ViewModel: DropDelegate { extension StatusEditor.ViewModel: DropDelegate {
public func performDrop(info: DropInfo) -> Bool { 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) processItemsProvider(items: item)
return true return true
} }