about summary refs log tree commit diff
path: root/app/views/media
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-07-05 18:28:25 +0200
committerGitHub <noreply@github.com>2020-07-05 18:28:25 +0200
commit99f3a5554074d9a12619797c474b3de4c6085f02 (patch)
treed0b190d57da39c764b0dde853f072a6479534845 /app/views/media
parent2f2ab48b750ab1fb62a9b7a3ea1c8cc52f3c7366 (diff)
Add color extraction for audio thumbnails (#14209)
Diffstat (limited to 'app/views/media')
-rw-r--r--app/views/media/player.html.haml2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/media/player.html.haml b/app/views/media/player.html.haml
index 3d308ee69..1d0374897 100644
--- a/app/views/media/player.html.haml
+++ b/app/views/media/player.html.haml
@@ -11,6 +11,6 @@
     %video{ autoplay: 'autoplay', muted: 'muted', loop: 'loop' }
       %source{ src: @media_attachment.file.url(:original) }
 - elsif @media_attachment.audio?
-  = react_component :audio, src: @media_attachment.file.url(:original), poster: full_asset_url(@media_attachment.account.avatar_static_url), width: 670, height: 380, fullscreen: true, alt: @media_attachment.description, duration: @media_attachment.file.meta.dig(:original, :duration) do
+  = react_component :audio, src: @media_attachment.file.url(:original), poster: @media_attachment.thumbnail.present? ? @media_attachment.thumbnail.url : @media_attachment.account.avatar_static_url, backgroundColor: @media_attachment.file.meta.dig('colors', 'background'), foregroundColor: @media_attachment.file.meta.dig('colors', 'foreground'), accentColor: @media_attachment.file.meta.dig('colors', 'accent'), width: 670, height: 380, fullscreen: true, alt: @media_attachment.description, duration: @media_attachment.file.meta.dig(:original, :duration) do
     %audio{ controls: 'controls' }
       %source{ src: @media_attachment.file.url(:original) }