Skip to content
Snippets Groups Projects
Commit cdc49c6b authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Allow mp4 uploads, convert to WebM

parent 5e511acb
No related branches found
No related tags found
No related merge requests found
class MediaAttachment < ApplicationRecord
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze
VIDEO_MIME_TYPES = ['video/webm'].freeze
VIDEO_MIME_TYPES = ['video/webm', 'video/mp4'].freeze
belongs_to :account, inverse_of: :media_attachments
belongs_to :status, inverse_of: :media_attachments
......@@ -43,14 +43,19 @@ private
}
else
{
small: {
convert_options: {
output: {
vf: 'scale="min(510\, iw):min(680\, ih)":force_original_aspect_ratio=decrease'
}
original: {
convert_options: {},
format: 'webm'
},
format: 'png',
time: 1
small: {
convert_options: {
output: {
vf: 'scale="min(510\, iw):min(680\, ih)":force_original_aspect_ratio=decrease'
}
},
format: 'png',
time: 1
}
}
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment