Add video type support for media attachement (reading)
This commit is contained in:
parent
f215298917
commit
b2d4d151e5
|
@ -1,6 +1,7 @@
|
|||
import SwiftUI
|
||||
import Env
|
||||
|
||||
@MainActor
|
||||
extension View {
|
||||
public func statusEditorToolbarItem(routeurPath: RouterPath) -> some ToolbarContent {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
|
|
|
@ -11,7 +11,7 @@ public struct MediaAttachement: Codable, Identifiable, Hashable {
|
|||
}
|
||||
|
||||
public enum SupportedType: String {
|
||||
case image, gifv
|
||||
case image, gifv, video
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
|
|
|
@ -126,7 +126,7 @@ public struct StatusMediaPreviewView: View {
|
|||
.shimmering()
|
||||
})
|
||||
}
|
||||
case .gifv:
|
||||
case .gifv, .video:
|
||||
if let url = attachement.url {
|
||||
VideoPlayerView(viewModel: .init(url: url))
|
||||
.frame(height: imageMaxHeight)
|
||||
|
@ -158,7 +158,7 @@ public struct StatusMediaPreviewView: View {
|
|||
}
|
||||
.frame(width: isCompact ? imageMaxHeight : proxy.frame(in: .local).width)
|
||||
.frame(height: imageMaxHeight)
|
||||
case .gifv:
|
||||
case .gifv, .video:
|
||||
if let url = attachement.url {
|
||||
VideoPlayerView(viewModel: .init(url: url))
|
||||
.frame(width: isCompact ? imageMaxHeight : proxy.frame(in: .local).width)
|
||||
|
|
Loading…
Reference in New Issue