mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
Add 'loop' attribute for videos in 'gifs' communities
This commit is contained in:
parent
ade07d2658
commit
bd7df400aa
2 changed files with 5 additions and 2 deletions
|
@ -545,6 +545,9 @@ class Community(db.Model):
|
|||
return True
|
||||
return False
|
||||
|
||||
def loop_videos(self) -> bool:
|
||||
return 'gifs' in self.name
|
||||
|
||||
def delete_dependencies(self):
|
||||
for post in self.posts:
|
||||
post.delete_dependencies()
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<p><audio controls preload="{{ 'none' if low_bandwidth else 'metadata' }}" src="{{ post.url }}"></audio></p>
|
||||
{% elif post.url.endswith('.mp4') or post.url.endswith('.webm') %}
|
||||
<p>
|
||||
<video class="responsive-video" controls preload="{{ 'metadata' if low_bandwidth else 'auto' }}">
|
||||
<video class="responsive-video" controls preload="{{ 'metadata' if low_bandwidth else 'auto' }}" {{ 'loop' if post.community.loop_videos() }}>
|
||||
{% if post.url.endswith('.mp4') %}
|
||||
<source src="{{ post.url }}" type="video/mp4" />
|
||||
{% elif post.url.endswith('.webm') %}
|
||||
|
@ -106,7 +106,7 @@
|
|||
<span class="fe fe-external"></span></a></p>
|
||||
{% if post.url.endswith('.mp4') or post.url.endswith('.webm') %}
|
||||
<p>
|
||||
<video class="responsive-video" controls preload="{{ 'none' if low_bandwidth else 'auto' }}" {{ 'autoplay muted' if autoplay }}>
|
||||
<video class="responsive-video" controls preload="{{ 'none' if low_bandwidth else 'auto' }}" {{ 'autoplay muted' if autoplay }} {{ 'loop' if post.community.loop_videos() }}>
|
||||
{% if post.url.endswith('.mp4') %}
|
||||
<source src="{{ post.url }}" type="video/mp4" />
|
||||
{% elif post.url.endswith('.webm') %}
|
||||
|
|
Loading…
Add table
Reference in a new issue