Community Wishlist Survey 2022/Multimedia and Commons/Audio links that play on click

Audio links that play on click

  • Problem: For referencing audio files inline, such as pronunciation demonstrations, wikis have relied on linking to the raw file using [[Media:...]], via templates like {{audio}}. But not all browsers support playing the linked file (which can be Ogg Vorbis, WAV, FLAC, WebM, Opus, or MIDI), causing them to download the file instead of playing it, even though audio files are now automatically transcoded into Ogg and MP3 specifically so that browsers can play them. And even when the browser supports it, this is not user-friendly as it suddenly sends them to a different page with nothing but a player on it.
  • Proposed solution: Create a parser extension tag like <audio file="Example.ogg">Link</audio> which fetches the derivative URLs and then converts to e.g. <a href="/wiki/File:Example.ogg" title="Example.ogg" data-audiolink="[{"src":"//upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg","type":"audio/ogg"},{"src":"//upload.wikimedia.org/wikipedia/commons/transcoded/c/c8/Example.ogg/Example.ogg.mp3","type":"audio/mpeg"}]">Link</a> and attach a handler that converts the JSON data to an HTMLAudioElement and plays it to the link's click event.
  • Who would benefit: Readers
  • More comments:
  • Phabricator tickets: T229169
  • Proposer: Nardog (talk) 07:37, 21 January 2022 (UTC)[reply]

Discussion

Voting