From 49ebda4d49af50b375126e4a8285686fb6448a60 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 21 Jun 2019 22:59:44 +0200 Subject: [PATCH] Change audio format from ogg to mp3 for wider compatibility (#11141) * Change audio format from ogg to mp3 for wider compatibility * Add media description as title to links of unknown media attachments --- app/javascript/mastodon/components/media_gallery.js | 2 +- app/javascript/styles/mastodon/components.scss | 1 + app/models/media_attachment.rb | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index 56618462b4..77bac61eec 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/mastodon/components/media_gallery.js @@ -157,7 +157,7 @@ class Item extends React.PureComponent { if (attachment.get('type') === 'unknown') { return (
- +
diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 545427d222..4a0d64ad38 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -557,6 +557,7 @@ .compose-form__upload-thumbnail { border-radius: 4px; + background-color: $base-shadow-color; background-position: center; background-size: cover; background-repeat: no-repeat; diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index ae94ce68a1..4c55d4b987 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -69,9 +69,13 @@ class MediaAttachment < ApplicationRecord AUDIO_STYLES = { original: { - format: 'ogg', - content_type: 'audio/ogg', - convert_options: {}, + format: 'mp3', + content_type: 'audio/mpeg', + convert_options: { + output: { + 'q:a' => 2, + }, + }, }, }.freeze