Fix video player not being displayed in reports interface (#26801)

lolsob-rspec
Claire 2023-09-05 20:05:58 +02:00 committed by GitHub
parent 773e2d44f2
commit 529ee44ff6
2 changed files with 2 additions and 2 deletions

View File

@ -14,6 +14,7 @@ module MediaComponentHelper
blurhash: video.blurhash, blurhash: video.blurhash,
frameRate: meta.dig('original', 'frame_rate'), frameRate: meta.dig('original', 'frame_rate'),
inline: true, inline: true,
aspectRatio: "#{meta.dig('original', 'width')} / #{meta.dig('original', 'height')}",
media: [ media: [
serialize_media_attachment(video), serialize_media_attachment(video),
].as_json, ].as_json,

View File

@ -1,6 +1,5 @@
- if status.ordered_media_attachments.first.video? - if status.ordered_media_attachments.first.video?
- video = status.ordered_media_attachments.first = render_video_component(status, visible: false)
= 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
- elsif status.ordered_media_attachments.first.audio? - elsif status.ordered_media_attachments.first.audio?
- audio = status.ordered_media_attachments.first - 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) = react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, lang: status.language, duration: audio.file.meta.dig(:original, :duration)