2020-06-25 00:33:01 +01:00
|
|
|
- content_for :header_tags do
|
|
|
|
= render_initial_state
|
|
|
|
= javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
|
|
|
|
|
|
|
|
- if @media_attachment.video?
|
2020-07-09 11:53:16 +01:00
|
|
|
= react_component :video, src: @media_attachment.file.url(:original), preview: @media_attachment.thumbnail.present? ? @media_attachment.thumbnail.url : @media_attachment.file.url(:small), blurhash: @media_attachment.blurhash, width: 670, height: 380, editable: true, detailed: true, inline: true, alt: @media_attachment.description do
|
2020-06-25 00:33:01 +01:00
|
|
|
%video{ controls: 'controls' }
|
|
|
|
%source{ src: @media_attachment.file.url(:original) }
|
|
|
|
- elsif @media_attachment.gifv?
|
|
|
|
= react_component :media_gallery, height: 380, standalone: true, autoplay: true, media: [ActiveModelSerializers::SerializableResource.new(@media_attachment, serializer: REST::MediaAttachmentSerializer).as_json] do
|
|
|
|
%video{ autoplay: 'autoplay', muted: 'muted', loop: 'loop' }
|
|
|
|
%source{ src: @media_attachment.file.url(:original) }
|
|
|
|
- elsif @media_attachment.audio?
|
2020-07-05 17:28:25 +01:00
|
|
|
= 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
|
2020-06-25 00:33:01 +01:00
|
|
|
%audio{ controls: 'controls' }
|
|
|
|
%source{ src: @media_attachment.file.url(:original) }
|