Răsfoiți Sursa

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
Lauri Ojansivu 3 ani în urmă
părinte
comite
bd9fbedbf9

+ 12 - 0
client/components/cards/attachments.jade

@@ -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

+ 1 - 1
client/components/cards/attachments.styl

@@ -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