Add more file properties, organize storage, add video block

This commit is contained in:
Christoph Hagen
2025-01-06 15:31:19 +01:00
parent 96c0a75c2f
commit 6cf310d849
25 changed files with 712 additions and 219 deletions

View File

@ -0,0 +1,19 @@
struct VersionedVideo: HtmlProducer {
let sources: [VideoBlock.Source]
let options: [VideoBlock.Option]
func populate(_ result: inout String) {
result += "<video\(optionString)>Video not supported."
for source in sources.sorted(using: { $0.type.order }) {
result += "<source src='\(source.file.absoluteUrl)' type='\(source.type.mimeType)'>"
}
result += "</video>"
}
private var optionString: String {
options.map { " " + $0.rawValue }.joined()
}
}