Allow videos in posts, simplify post image view

This commit is contained in:
Christoph Hagen
2025-01-17 23:24:56 +01:00
parent 60716fca20
commit bc3f21e7e4
10 changed files with 175 additions and 172 deletions

View File

@@ -0,0 +1,14 @@
struct PostVideo: HtmlProducer {
let videos: [FileResource]
func populate(_ result: inout String) {
result += "<video autoplay loop muted>"
result += "Video not supported."
for video in videos {
result += "<source src='\(video.absoluteUrl)' type='\(video.type.htmlType!)'>"
}
result += "</video>"
}
}