mirror of
https://github.com/zedeus/nitter.git
synced 2024-11-14 12:41:12 +00:00
20 lines
542 B
Nim
20 lines
542 B
Nim
|
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")):
|
||
|
renderHead(prefs, cfg, `type`="video", images = @[thumb], video=vidUrl)
|
||
|
|
||
|
tdiv(class="embed-video"):
|
||
|
renderVideo(get(tweet.video), prefs, "")
|
||
|
|
||
|
result = doctype & $node
|