diff options
author | cel 🌸 <cel@blos.sm> | 2024-07-16 13:12:33 +0100 |
---|---|---|
committer | cel 🌸 <cel@blos.sm> | 2024-07-16 13:12:33 +0100 |
commit | fd0ea710395904e1b4cf5f22fd17af13db43ce5f (patch) | |
tree | c694efa675d3ad1daab3b1d9cfea737a805f1977 /templates/thumbs.html | |
parent | e5e763f1d7d473b22d8c2e7f4a0058ada7832c24 (diff) | |
download | infoculture.pub-fd0ea710395904e1b4cf5f22fd17af13db43ce5f.tar.gz infoculture.pub-fd0ea710395904e1b4cf5f22fd17af13db43ce5f.tar.bz2 infoculture.pub-fd0ea710395904e1b4cf5f22fd17af13db43ce5f.zip |
webtorrent and teaser support
Diffstat (limited to '')
-rw-r--r-- | templates/thumbs.html | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/templates/thumbs.html b/templates/thumbs.html index 91cfd74..3fcc6f7 100644 --- a/templates/thumbs.html +++ b/templates/thumbs.html @@ -5,6 +5,17 @@ <div class="thumbnail" style="height: 25vh">$thumbnail$</div> <br> $endif$ + $if(torrent)$ + <video controls class="thumbnail" id="media-$id$" style="height: 30vh;"></video> + <script type='module'> + const torrentId = '$torrent$'; + const player = document.querySelector('#media-$id$'); + window.torrentClient.add(torrentId, torrent => { + const file = torrent.files.find(file => file.name.endsWith('.mp4')); + file.streamTo(player); + }); + </script> + $endif$ <div class="thumb-title"> <a href="$url$"> <h2>$title$</h2> @@ -22,6 +33,11 @@ $subtitle$ </div> $endif$ + $if(teaser)$ + <div class="thumb-teaser"> + $teaser$<a href="$url$">read more...</a> + </div> + $endif$ </div> $endfor$ -</div>
\ No newline at end of file +</div> |