From 9547d3d6019fa14f8330bf89a705025c18525c30 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 1 Sep 2024 22:54:20 +0100 Subject: support video preview and playback with hls streams --- src/mixins/comment.pug | 3 +++ src/mixins/post.pug | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/mixins') diff --git a/src/mixins/comment.pug b/src/mixins/comment.pug index ec01dad..545ee59 100644 --- a/src/mixins/comment.pug +++ b/src/mixins/comment.pug @@ -10,6 +10,9 @@ mixin comment(com, isfirst) div.comment-info-container div.info-item u/#{data.author} div.info-item ↑ #{fmtnum(data.ups)} + if data.collapsed_reason_code == "DELETED" + div.info-item + a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete div.comment-body != data.body_html div.replies diff --git a/src/mixins/post.pug b/src/mixins/post.pug index f5819d4..cbe2365 100644 --- a/src/mixins/post.pug +++ b/src/mixins/post.pug @@ -4,7 +4,8 @@ mixin post(p) div.post-container div.post-text div.title-container - != p.title + a(href=`/comments/${p.id}`) + != p.title span.domain (#{p.domain}) div.info-container div.info-item ↑ #{fmtnum(p.ups)} @@ -17,9 +18,9 @@ mixin post(p) if p.post_hint == "image" || p.post_hint == "link" if p.thumbnail && p.thumbnail != "self" || p.thumbnail != "default" a(href=p.url) - img(src=p.thumbnail width='100px') - else if p.post_hint == "hosted:video" - - var url = p.secure_media.reddit_video.fallback_url - a(href=url) - video(src=url height='100px') + img(src=p.thumbnail width='100px' height='100px') + else if p.post_hint == "hosted:video" + - var url = p.secure_media.reddit_video.dash_url + a(href=url) + video(src=url controls data-dashjs-player="" width='100px' height='100px') -- cgit v1.2.3