Skip to content

Commit

Permalink
Fix video player not being displayed in reports interface (mastodon#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored and vmstan committed Jan 5, 2024
1 parent 90b719b commit a58f13c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/helpers/media_component_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def render_video_component(status, **options)
blurhash: video.blurhash,
frameRate: meta.dig('original', 'frame_rate'),
inline: true,
aspectRatio: "#{meta.dig('original', 'width')} / #{meta.dig('original', 'height')}",
media: [
serialize_media_attachment(video),
].as_json,
Expand Down
3 changes: 1 addition & 2 deletions app/views/admin/reports/_media_attachments.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- if status.ordered_media_attachments.first.video?
- video = status.ordered_media_attachments.first
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), frameRate: video.file.meta.dig('original', 'frame_rate'), blurhash: video.blurhash, sensitive: status.sensitive?, visible: false, width: 610, height: 343, inline: true, alt: video.description, lang: status.language, media: [ActiveModelSerializers::SerializableResource.new(video, serializer: REST::MediaAttachmentSerializer)].as_json
= render_video_component(status, visible: false)
- elsif status.ordered_media_attachments.first.audio?
- audio = status.ordered_media_attachments.first
= react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, lang: status.language, duration: audio.file.meta.dig(:original, :duration)
Expand Down

0 comments on commit a58f13c

Please sign in to comment.