Preliminary video support

This commit is contained in:
Zed
2019-06-20 17:20:32 +02:00
parent cea5cc0523
commit a9826151e9
4 changed files with 45 additions and 6 deletions

View File

@@ -55,6 +55,19 @@
</div>
#end proc
#
#proc renderVideo(tweet: Tweet): string =
<div class="attachments media-body">
<div class="gallery-row" style="max-height: unset;">
<div class="attachment image">
<video poster=${tweet.videoThumb} style="width: 100%; height: 100%;" autoplay muted loop></video>
<div class="video-overlay">
<p>Video playback not supported</p>
</div>
</div>
</div>
</div>
#end proc
#
#proc renderGif(tweet: Tweet): string =
#let thumbUrl = getGifThumb(tweet).getSigUrl("pic")
#let videoUrl = getGifSrc(tweet).getSigUrl("video")
@@ -89,6 +102,8 @@
</div>
#if tweet.photos.len > 0:
${renderMediaGroup(tweet)}
#elif tweet.videoThumb.len > 0:
${renderVideo(tweet)}
#elif tweet.gif.len > 0:
${renderGif(tweet)}
#end if