Page MenuHomePhabricator

Audio file embeds have messed up thumbnails in VisualEditor
Closed, ResolvedPublic

Description

Audio file embeds have messed up thumbnails in VisualEditor.

Example: https://en.wikipedia.org/wiki/South_Park?veaction=edit&section=10#Main_theme

(It was pretty difficult to find a real example, most audio embeds on Wikipedia are done using a variety of templates like Template:Listen and Template:Spoken Wikipedia. I can only hope y'all are not easily offended.)

image.png (448×1 px, 118 KB)

There are a few issues:

  • Obviously, the thumbnail is stretched. There is no image to be generated for an audio-only file, so the imageinfo API responds with this file regardless of the requested thumbnail size: https://en.wikipedia.org/w/resources/assets/file-type-icons/fileicon-ogg.png
  • Attempting to resize the image (by dragging the corner) will instead immediately scale it to 0x0px
  • "Image size" controls are present in the media dialog, but not functioning

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 506923 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Improve rendering of audio files

https://gerrit.wikimedia.org/r/506923

Change 506923 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Improve rendering of audio files

https://gerrit.wikimedia.org/r/506923

Issues with the patch:

  • The MediaWiki-generated fake thumbnail is not suppressed
  • The same treatment is needed for inline images

Issues with the patch:

  • The MediaWiki-generated fake thumbnail is not suppressed

Parsoid-generated. Currently we get the media type from the API, so we don't know immediately it's audio. As Parsoid now has <audio> tags would could suppress this src during toDataElement.

  • The same treatment is needed for inline images

Inline audio doesn't really work, it renders as block and so should probably be completely avoided.

Change 572138 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Improve rendering of audio files (for real this time)

https://gerrit.wikimedia.org/r/572138

Change 572138 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Improve rendering of audio files (for real this time)

https://gerrit.wikimedia.org/r/572138

Static image of an audio player seems to be appearing:

Screen Shot 2020-10-21 at 6.32.00 PM.png (570×864 px, 125 KB)