forked from MarseyWorld/MarseyWorld
posters for videos
parent
4439f03ef5
commit
02eb014dd8
|
@ -747,8 +747,8 @@ def submit_post(v:User, sub=None):
|
||||||
post.url = process_video(file, v)
|
post.url = process_video(file, v)
|
||||||
name = f'/images/{time.time()}'.replace('.','') + '.webp'
|
name = f'/images/{time.time()}'.replace('.','') + '.webp'
|
||||||
subprocess.run(['ffmpeg', '-y', '-loglevel', 'warning',
|
subprocess.run(['ffmpeg', '-y', '-loglevel', 'warning',
|
||||||
'-i', post.url, '-vf', '"select=eq(n\,0)"', '-vf',
|
'-i', post.url, '-vf', "scale='min(300,iw)':-2",
|
||||||
'scale=100:-2', '-q:v', '3', '-frames:v', '1', name], check=True)
|
'-q:v', '3', '-frames:v', '1', name], check=True)
|
||||||
post.thumburl = name
|
post.thumburl = name
|
||||||
elif file.content_type.startswith('audio/'):
|
elif file.content_type.startswith('audio/'):
|
||||||
post.url = process_audio(file, v)
|
post.url = process_audio(file, v)
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
<div class="row no-gutters mb-4">
|
<div class="row no-gutters mb-4">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="resizable bigger">
|
<p class="resizable bigger">
|
||||||
<video controls preload="none" src="{{p.realurl(v)}}"></video>
|
<video {% if p.thumb_url %}poster="{{p.thumb_url}}"{% endif %} controls preload="none" src="{{p.realurl(v)}}"></video>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -248,7 +248,7 @@
|
||||||
{% elif p.is_video %}
|
{% elif p.is_video %}
|
||||||
<div id="video-{{p.id}}" class="ml-5 {% if p.over_18 or not ((v and v.cardview) or (not v and CARD_VIEW)) %}d-none{% endif %} mt-4">
|
<div id="video-{{p.id}}" class="ml-5 {% if p.over_18 or not ((v and v.cardview) or (not v and CARD_VIEW)) %}d-none{% endif %} mt-4">
|
||||||
<p class="resizable bigger">
|
<p class="resizable bigger">
|
||||||
<video id="video2-{{p.id}}" controls preload="none" src="{{p.realurl(v)}}"></video>
|
<video {% if p.thumb_url %}poster="{{p.thumb_url}}"{% endif %} id="video2-{{p.id}}" controls preload="none" src="{{p.realurl(v)}}"></video>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{% elif p.is_audio %}
|
{% elif p.is_audio %}
|
||||||
|
|
Loading…
Reference in New Issue