nitter/src/views/embed.nim

20 lines
526 B
Nim
Raw Normal View History

2019-12-06 14:15:56 +00:00
import options
import karax/[karaxdsl, vdom]
import ".."/[types, formatters]
import general, tweet
const doctype = "<!DOCTYPE html>\n"
proc renderVideoEmbed*(cfg: Config; tweet: Tweet): string =
let thumb = get(tweet.video).thumb
let vidUrl = getVideoEmbed(cfg, tweet.id)
let prefs = Prefs(hlsPlayback: true)
let node = buildHtml(html(lang="en")):
2019-12-08 11:38:55 +00:00
renderHead(prefs, cfg, video=vidUrl, images=(@[thumb]))
2019-12-06 14:15:56 +00:00
tdiv(class="embed-video"):
renderVideo(get(tweet.video), prefs, "")
result = doctype & $node