feat: 展示出来视频

This commit is contained in:
jinyaqiu 2025-09-02 17:54:09 +08:00
parent 0670c686d2
commit 68582b82cb
2 changed files with 9 additions and 3 deletions

View File

@ -305,8 +305,8 @@ public class ImageUploaderGetID: ObservableObject {
}
print("✅ 成功获取上传URL")
print(" - 文件ID: \(fileId)")
print(" - 上传URL: \(uploadURLString)")
print(" ❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️ - 文件ID: \(fileId)")
print(" - 上传URL: \(uploadURLString)")
completion(.success((fileId: fileId, uploadURL: uploadURL)))
} catch {

View File

@ -27,7 +27,7 @@ struct MemoryItem: Identifiable, Decodable {
var title: String { name ?? "Untitled" }
var subtitle: String { description ?? "" }
var mediaType: MemoryMediaType {
let url = fileInfo.url.lowercased()
let url = fileInfo.fileName.lowercased()
if url.hasSuffix(".mp4") || url.hasSuffix(".mov") {
return .video(url: fileInfo.url, previewUrl: previewFileInfo.url)
} else {
@ -416,6 +416,9 @@ struct MemoryCard: View {
height: (UIScreen.main.bounds.width / 2 - 24) * (1/memory.aspectRatio))
.clipped()
.cornerRadius(12)
.onAppear {
print(" Memory Card Appeared - Media Type: \(memory.mediaType)")
}
// Show play button for videos
if case .video = memory.mediaType {
@ -432,6 +435,9 @@ struct MemoryCard: View {
.font(Typography.font(for: .body, family: .quicksandBold))
.foregroundColor(.themeTextMessageMain)
.lineLimit(1)
.onTapGesture {
print("🐰🐰🐰🐰🐰🐰🐰🐰🐰🐰🐰 \(memory)")
}
Text(memory.subtitle)
.font(.system(size: 14))