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