Add more file properties, organize storage, add video block
This commit is contained in:
@ -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()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user