Skip to content

Commit

Permalink
Merge pull request #288 from Planetable/update-media-view
Browse files Browse the repository at this point in the history
Update media view framework, using minor version dependency.
  • Loading branch information
livid committed Oct 30, 2023
2 parents 9f44965 + e4faeef commit db35e38
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Planet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2370,8 +2370,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/airwolfspace/mediaview";
requirement = {
branch = main;
kind = branch;
kind = upToNextMinorVersion;
minimumVersion = 1.0.0;
};
};
6A2A4D2A2A86422700F4491A /* XCRemoteSwiftPackageReference "WrappingHStack" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/airwolfspace/mediaview",
"state" : {
"branch" : "main",
"revision" : "b1442b2371bd7c141f86b1331c83358bf1885806"
"revision" : "c64f8e9056203cdde5493ed469b350e14217b053",
"version" : "1.0.0"
}
},
{
Expand Down
14 changes: 12 additions & 2 deletions PlanetLite/AppContentItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,19 @@ struct AppContentItemView: View {

private func processAttachments(_ urls: [URL]) {
if article.hasVideo {
ASMediaManager.shared.activateVideoView(withVideos: urls, title: article.title, andID: article.id)
DispatchQueue.global(qos: .userInitiated).async {
if let videoThumbnail = self.article.getVideoThumbnail(), !CGSizeEqualToSize(.zero, videoThumbnail.size) {
DispatchQueue.main.async {
ASMediaManager.shared.activateVideoView(withVideos: urls, title: self.article.title, id: self.article.id, defaultSize: videoThumbnail.size)
}
} else {
DispatchQueue.main.async {
ASMediaManager.shared.activateVideoView(withVideos: urls, title: self.article.title, id: self.article.id)
}
}
}
} else {
ASMediaManager.shared.activatePhotoView(withPhotos: urls, title: article.title, andID: article.id)
ASMediaManager.shared.activatePhotoView(withPhotos: urls, title: article.title, id: article.id)
}
}

Expand Down

0 comments on commit db35e38

Please sign in to comment.