Implement mixed-media tweet support

Fixes #697 #1101
This commit is contained in:
Zed 2026-03-13 05:47:37 +01:00
commit 35a929c415
15 changed files with 305 additions and 175 deletions

View file

@ -9,14 +9,17 @@ import general, tweet
const doctype = "<!DOCTYPE html>\n"
proc renderVideoEmbed*(tweet: Tweet; cfg: Config; req: Request): string =
let thumb = get(tweet.video).thumb
let vidUrl = getVideoEmbed(cfg, tweet.id)
let prefs = Prefs(hlsPlayback: true, mp4Playback: true)
let
video = tweet.getVideos()[0]
thumb = video.thumb
vidUrl = getVideoEmbed(cfg, tweet.id)
prefs = Prefs(hlsPlayback: true, mp4Playback: true)
let node = buildHtml(html(lang="en")):
renderHead(prefs, cfg, req, video=vidUrl, images=(@[thumb]))
body:
tdiv(class="embed-video"):
renderVideo(get(tweet.video), prefs, "")
renderVideo(video, prefs, "")
result = doctype & $node