20 lines
443 B
Swift
20 lines
443 B
Swift
|
|
struct ContentPageVideo: HtmlProducer {
|
|
|
|
let filePath: String
|
|
|
|
let videoType: String
|
|
|
|
let options: [VideoCommand.Option]
|
|
|
|
func populate(_ result: inout String) {
|
|
result += "<video\(optionString)>Video not supported."
|
|
result += "<source src='\(filePath)' type='\(videoType)'>"
|
|
result += "</video>"
|
|
}
|
|
|
|
private var optionString: String {
|
|
options.map { " " + $0.rawValue }.joined()
|
|
}
|
|
}
|