At card attachments, show play and fullscreen controls for video webm/mp4/ogg, and play controls for audio mp3/ogg.

Thanks to luistiktok and xet7 !

Fixes #4013
This commit is contained in:
Lauri Ojansivu 2021-09-17 04:16:56 +03:00
parent 6c0a958481
commit bd9fbedbf9
2 changed files with 13 additions and 1 deletions

View file

@ -26,6 +26,18 @@ template(name="attachmentsGalery")
if isUploaded
if isImage
img.attachment-thumbnail-img(src="{{url}}")
else if($eq extension 'mp3')
video(width="100%" height="100%" controls="true")
source(src="{{url}}" type="audio/mpeg")
else if($eq extension 'ogg')
video(width="100%" height="100%" controls="true")
source(src="{{url}}" type="video/ogg")
else if($eq extension 'webm')
video(width="100%" height="100%" controls="true")
source(src="{{url}}" type="video/webm")
else if($eq extension 'mp4')
video(width="100%" height="100%" controls="true")
source(src="{{url}}" type="video/mp4")
else
span.attachment-thumbnail-ext= extension
else

View file

@ -9,7 +9,7 @@
margin: 10px 1% 0
text-align: center
border-radius: 3px
overflow: hidden
overflow: auto
background: darken(white, 7%)
min-height: 120px