diff --git a/Tusker.xcodeproj/project.pbxproj b/Tusker.xcodeproj/project.pbxproj index dfbdc1cc7e..05db16609a 100644 --- a/Tusker.xcodeproj/project.pbxproj +++ b/Tusker.xcodeproj/project.pbxproj @@ -195,7 +195,7 @@ D6934F3A2BA8F3D7002B1C8D /* FallbackGalleryContentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6934F392BA8F3D7002B1C8D /* FallbackGalleryContentViewController.swift */; }; D6934F3C2BAA0F80002B1C8D /* VideoGalleryContentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6934F3B2BAA0F80002B1C8D /* VideoGalleryContentViewController.swift */; }; D6934F3E2BAA19D5002B1C8D /* ImageActivityItemSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6934F3D2BAA19D5002B1C8D /* ImageActivityItemSource.swift */; }; - D6934F402BAA19EC002B1C8D /* GifvActivityItemSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6934F3F2BAA19EC002B1C8D /* GifvActivityItemSource.swift */; }; + D6934F402BAA19EC002B1C8D /* VideoActivityItemSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6934F3F2BAA19EC002B1C8D /* VideoActivityItemSource.swift */; }; D693A72825CF282E003A14E2 /* TrendingHashtagsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D693A72725CF282E003A14E2 /* TrendingHashtagsViewController.swift */; }; D693A72F25CF91C6003A14E2 /* FeaturedProfileCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D693A72D25CF91C6003A14E2 /* FeaturedProfileCollectionViewCell.swift */; }; D693A73025CF91C6003A14E2 /* FeaturedProfileCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D693A72E25CF91C6003A14E2 /* FeaturedProfileCollectionViewCell.xib */; }; @@ -596,7 +596,7 @@ D6934F392BA8F3D7002B1C8D /* FallbackGalleryContentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FallbackGalleryContentViewController.swift; sourceTree = ""; }; D6934F3B2BAA0F80002B1C8D /* VideoGalleryContentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoGalleryContentViewController.swift; sourceTree = ""; }; D6934F3D2BAA19D5002B1C8D /* ImageActivityItemSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageActivityItemSource.swift; sourceTree = ""; }; - D6934F3F2BAA19EC002B1C8D /* GifvActivityItemSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifvActivityItemSource.swift; sourceTree = ""; }; + D6934F3F2BAA19EC002B1C8D /* VideoActivityItemSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoActivityItemSource.swift; sourceTree = ""; }; D693A72725CF282E003A14E2 /* TrendingHashtagsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrendingHashtagsViewController.swift; sourceTree = ""; }; D693A72D25CF91C6003A14E2 /* FeaturedProfileCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturedProfileCollectionViewCell.swift; sourceTree = ""; }; D693A72E25CF91C6003A14E2 /* FeaturedProfileCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FeaturedProfileCollectionViewCell.xib; sourceTree = ""; }; @@ -1348,7 +1348,7 @@ D681E4D6246E32290053414F /* StatusActivityItemSource.swift */, D681E4D8246E346E0053414F /* AccountActivityItemSource.swift */, D6934F3D2BAA19D5002B1C8D /* ImageActivityItemSource.swift */, - D6934F3F2BAA19EC002B1C8D /* GifvActivityItemSource.swift */, + D6934F3F2BAA19EC002B1C8D /* VideoActivityItemSource.swift */, D6AEBB3D2321638100E5038B /* UIActivity+Types.swift */, D6AEBB422321685E00E5038B /* OpenInSafariActivity.swift */, D6CA8CDD296387310050C433 /* SaveToPhotosActivity.swift */, @@ -2211,7 +2211,7 @@ D6E426B325337C7000C02E1C /* CustomEmojiImageView.swift in Sources */, D6D4DDD0212518A000E1C4BB /* AppDelegate.swift in Sources */, D61F75B3293BD89C00C0B37F /* UpdateFilterService.swift in Sources */, - D6934F402BAA19EC002B1C8D /* GifvActivityItemSource.swift in Sources */, + D6934F402BAA19EC002B1C8D /* VideoActivityItemSource.swift in Sources */, D6C3F5172991C1A00009FCFF /* View+AppListStyle.swift in Sources */, D65B4B6A297777D900DABDFB /* StatusNotFoundView.swift in Sources */, D6412B0924B0291E00F5412E /* MyProfileViewController.swift in Sources */, diff --git a/Tusker/Activities/GifvActivityItemSource.swift b/Tusker/Activities/VideoActivityItemSource.swift similarity index 94% rename from Tusker/Activities/GifvActivityItemSource.swift rename to Tusker/Activities/VideoActivityItemSource.swift index 9520aacc65..e72ec8d3a8 100644 --- a/Tusker/Activities/GifvActivityItemSource.swift +++ b/Tusker/Activities/VideoActivityItemSource.swift @@ -1,5 +1,5 @@ // -// GifvActivityItemSource.swift +// VideoActivityItemSource.swift // Tusker // // Created by Shadowfacts on 3/19/24. @@ -10,7 +10,7 @@ import UIKit import UniformTypeIdentifiers import AVFoundation -class GifvActivityItemSource: NSObject, UIActivityItemSource { +class VideoActivityItemSource: NSObject, UIActivityItemSource { let asset: AVAsset let url: URL diff --git a/Tusker/Screens/Gallery/GifvGalleryContentViewController.swift b/Tusker/Screens/Gallery/GifvGalleryContentViewController.swift index b8a11cd4d2..178ee1ecbe 100644 --- a/Tusker/Screens/Gallery/GifvGalleryContentViewController.swift +++ b/Tusker/Screens/Gallery/GifvGalleryContentViewController.swift @@ -11,13 +11,15 @@ import GalleryVC import Combine class GifvGalleryContentViewController: UIViewController, GalleryContentViewController { - let controller: GifvController + private let controller: GifvController + private let url: URL let caption: String? private var presentationSizeCancellable: AnyCancellable? - init(controller: GifvController, caption: String?) { + init(controller: GifvController, url: URL, caption: String?) { self.controller = controller + self.url = url self.caption = caption super.init(nibName: nil, bundle: nil) @@ -64,8 +66,7 @@ class GifvGalleryContentViewController: UIViewController, GalleryContentViewCont } var activityItemsForSharing: [Any] { - // TODO: share gifv - [] + [VideoActivityItemSource(asset: controller.item.asset, url: url)] } } diff --git a/Tusker/Screens/Gallery/StatusAttachmentsGalleryDataSource.swift b/Tusker/Screens/Gallery/StatusAttachmentsGalleryDataSource.swift index eeffebc4bb..952867d6e0 100644 --- a/Tusker/Screens/Gallery/StatusAttachmentsGalleryDataSource.swift +++ b/Tusker/Screens/Gallery/StatusAttachmentsGalleryDataSource.swift @@ -71,7 +71,7 @@ class StatusAttachmentsGalleryDataSource: GalleryDataSource { } else { GifvController(asset: AVAsset(url: attachment.url)) } - return GifvGalleryContentViewController(controller: controller, caption: attachment.description) + return GifvGalleryContentViewController(controller: controller, url: attachment.url, caption: attachment.description) case .video: return VideoGalleryContentViewController(url: attachment.url, caption: attachment.description) case .audio: diff --git a/Tusker/Screens/Gallery/VideoGalleryContentViewController.swift b/Tusker/Screens/Gallery/VideoGalleryContentViewController.swift index 2aee0c741f..4d14dca34b 100644 --- a/Tusker/Screens/Gallery/VideoGalleryContentViewController.swift +++ b/Tusker/Screens/Gallery/VideoGalleryContentViewController.swift @@ -92,8 +92,7 @@ class VideoGalleryContentViewController: UIViewController, GalleryContentViewCon } var activityItemsForSharing: [Any] { - // TODO: share videos - [] + [VideoActivityItemSource(asset: item.asset, url: url)] } } diff --git a/Tusker/Views/Attachments/AttachmentView.swift b/Tusker/Views/Attachments/AttachmentView.swift index 44b6f2a525..f84a1383a3 100644 --- a/Tusker/Views/Attachments/AttachmentView.swift +++ b/Tusker/Views/Attachments/AttachmentView.swift @@ -448,7 +448,7 @@ extension AttachmentView: UIContextMenuInteractionDelegate { return ImageGalleryContentViewController(url: self.attachment.url, caption: nil, originalData: nil, image: image, gifController: self.gifController) } else if self.attachment.kind == .gifv, let gifvView { - return GifvGalleryContentViewController(controller: gifvView.controller, caption: nil) + return GifvGalleryContentViewController(controller: gifvView.controller, url: self.attachment.url, caption: nil) } else if self.attachment.kind == .video || self.attachment.kind == .audio { let vc = VideoGalleryContentViewController(url: self.attachment.url, caption: nil) vc.player.isMuted = true @@ -478,8 +478,8 @@ extension AttachmentView: UIContextMenuInteractionDelegate { itemSource = ImageActivityItemSource(data: data, url: url, image: image) itemData = Task { data } } - } else if self.attachment.kind == .gifv { - itemSource = GifvActivityItemSource(asset: AVAsset(url: self.attachment.url), url: self.attachment.url) + } else if self.attachment.kind == .gifv || self.attachment.kind == .video { + itemSource = VideoActivityItemSource(asset: AVAsset(url: self.attachment.url), url: self.attachment.url) itemData = Task { try? await URLSession.shared.data(from: self.attachment.url).0 }