Add missing video descriptions (#8416)

* Pass through video description as necessary.

* Add title to video, matching aria-label.
master
M Somerville 6 years ago committed by Eugen Rochko
parent 869a3af3c0
commit ac092d03e7
  1. 1
      app/javascript/mastodon/components/extended_video_player.js
  2. 1
      app/javascript/mastodon/components/media_gallery.js
  3. 1
      app/javascript/mastodon/components/status.js
  4. 1
      app/javascript/mastodon/features/report/components/status_check_box.js
  5. 1
      app/javascript/mastodon/features/status/components/detailed_status.js
  6. 1
      app/javascript/mastodon/features/video/index.js
  7. 2
      app/views/admin/reports/_status.html.haml
  8. 2
      app/views/stream_entries/_detailed_status.html.haml
  9. 2
      app/views/stream_entries/_simple_status.html.haml

@ -50,6 +50,7 @@ export default class ExtendedVideoPlayer extends React.PureComponent {
role='button' role='button'
tabIndex='0' tabIndex='0'
aria-label={alt} aria-label={alt}
title={alt}
muted={muted} muted={muted}
controls={controls} controls={controls}
loop={!controls} loop={!controls}

@ -154,6 +154,7 @@ class Item extends React.PureComponent {
<video <video
className='media-gallery__item-gifv-thumbnail' className='media-gallery__item-gifv-thumbnail'
aria-label={attachment.get('description')} aria-label={attachment.get('description')}
title={attachment.get('description')}
role='application' role='application'
src={attachment.get('url')} src={attachment.get('url')}
onClick={this.handleClick} onClick={this.handleClick}

@ -230,6 +230,7 @@ export default class Status extends ImmutablePureComponent {
<Component <Component
preview={video.get('preview_url')} preview={video.get('preview_url')}
src={video.get('url')} src={video.get('url')}
alt={video.get('description')}
width={239} width={239}
height={110} height={110}
inline inline

@ -36,6 +36,7 @@ export default class StatusCheckBox extends React.PureComponent {
<Component <Component
preview={video.get('preview_url')} preview={video.get('preview_url')}
src={video.get('url')} src={video.get('url')}
alt={video.get('description')}
width={239} width={239}
height={110} height={110}
inline inline

@ -60,6 +60,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
<Video <Video
preview={video.get('preview_url')} preview={video.get('preview_url')}
src={video.get('url')} src={video.get('url')}
alt={video.get('description')}
width={300} width={300}
height={150} height={150}
inline inline

@ -315,6 +315,7 @@ export default class Video extends React.PureComponent {
role='button' role='button'
tabIndex='0' tabIndex='0'
aria-label={alt} aria-label={alt}
title={alt}
width={width} width={width}
height={height} height={height}
onClick={this.togglePlay} onClick={this.togglePlay}

@ -14,7 +14,7 @@
- unless status.proper.media_attachments.empty? - unless status.proper.media_attachments.empty?
- if status.proper.media_attachments.first.video? - if status.proper.media_attachments.first.video?
- video = status.proper.media_attachments.first - video = status.proper.media_attachments.first
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: status.proper.sensitive? && !current_account&.user&.setting_display_sensitive_media, width: 610, height: 343, inline: true = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: status.proper.sensitive? && !current_account&.user&.setting_display_sensitive_media, width: 610, height: 343, inline: true, alt: video.description
- else - else
= react_component :media_gallery, height: 343, sensitive: status.proper.sensitive? && !current_account&.user&.setting_display_sensitive_media, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } = react_component :media_gallery, height: 343, sensitive: status.proper.sensitive? && !current_account&.user&.setting_display_sensitive_media, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }

@ -21,7 +21,7 @@
- if !status.media_attachments.empty? - if !status.media_attachments.empty?
- if status.media_attachments.first.video? - if status.media_attachments.first.video?
- video = status.media_attachments.first - video = status.media_attachments.first
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, width: 670, height: 380, detailed: true, inline: true = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, width: 670, height: 380, detailed: true, inline: true, alt: video.description
- else - else
= react_component :media_gallery, height: 380, sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, standalone: true, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, 'reduceMotion': current_account&.user&.setting_reduce_motion, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } = react_component :media_gallery, height: 380, sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, standalone: true, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, 'reduceMotion': current_account&.user&.setting_reduce_motion, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }
- elsif status.preview_cards.first - elsif status.preview_cards.first

@ -24,7 +24,7 @@
- unless status.media_attachments.empty? - unless status.media_attachments.empty?
- if status.media_attachments.first.video? - if status.media_attachments.first.video?
- video = status.media_attachments.first - video = status.media_attachments.first
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, width: 610, height: 343, inline: true = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, width: 610, height: 343, inline: true, alt: video.description
- else - else
= react_component :media_gallery, height: 343, sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } = react_component :media_gallery, height: 343, sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }

Loading…
Cancel
Save