Made some changes in video upload for debugging only

This commit is contained in:
Arnfried Griesert
2024-02-02 11:04:43 +01:00
parent 0999fd3d7c
commit d080240b77
2 changed files with 60 additions and 13 deletions
+27 -9
View File
@@ -8078,18 +8078,36 @@ static CGSize kThreadListBarButtonItemImageSize;
}
});
}];
} else if ([itemProvider hasItemConformingToTypeIdentifier:(NSString *)UTTypeMovie]) {
[itemProvider loadItemForTypeIdentifier:(NSString *)UTTypeMovie options:nil completionHandler:^(id _Nullable object, NSError * _Nullable error) {
dispatch_async(dispatch_get_main_queue(), ^{
if ([object isKindOfClass:[NSURL class]]) {
NSURL *url = object;
if(url) {
AVURLAsset *selectedVideo = [AVURLAsset assetWithURL:url];
} else if ([itemProvider hasItemConformingToTypeIdentifier:@"public.movie"]) {
[itemProvider loadFileRepresentationForTypeIdentifier:@"public.movie" completionHandler:^(NSURL *videoURL, NSError *error) {
if (error) {
NSLog(@"Fehler beim Laden des Videos: %@", error);
} else {
NSLog(@"Video URL: %@", [videoURL absoluteString]);
NSString *dummy = [videoURL absoluteString];
if(videoURL) {
dispatch_sync(dispatch_get_main_queue(), ^{
AVURLAsset *selectedVideo = [AVURLAsset assetWithURL:videoURL];
[self sendVideoAsset:selectedVideo isPhotoLibraryAsset:NO];
}
});
}
});
// NSData *videoData = [NSData dataWithContentsOfURL:videoURL];
// Hier können Sie mit dem geladenen videoData arbeiten
// z.B. es in einem AVPlayer anzeigen oder auf einen Server hochladen
}
}];
// [itemProvider loadItemForTypeIdentifier:(NSString *)UTTypeMovie options:nil completionHandler:^(id _Nullable object, NSError * _Nullable error) {
// dispatch_async(dispatch_get_main_queue(), ^{
// if ([object isKindOfClass:[NSURL class]]) {
// NSURL *url = object;
// if(url) {
// AVURLAsset *selectedVideo = [AVURLAsset assetWithURL:url];
// [self sendVideoAsset:selectedVideo isPhotoLibraryAsset:NO];
// }
// }
// });
// }];
}
}
}