This is an archive of past discussions about Template:Listen. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.
Am I alone in thinking the present template is ugly? Would it be possible to have something much simpler and more elegant? For example the two icon expandable template used by Pew here. Any thoughts? --Kleinzach01:59, 21 June 2013 (UTC)
Tracking categories
I think it would be useful to add hidden tracking categories, based on the type parameter, so we sould have:
I suspect the majority of uses of this template do not use the parameter |type=. There are also many media files shown in articles without this template, analogous to how images are shown. In addition to these specifics, there is the more general question: "useful" for what? -- Michael Bednarek (talk) 00:28, 20 July 2013 (UTC)
please update to this version of the sandbox, which adds an |embed= option to allow the template to be used as a module in {{infobox person}}. once this update is made, the embed=yes version should have approximately the same width as the no embed or plain version. this is an improvement on the current plain=yes method, which removes the borders and icon, but still increases the width of the infobox. see the discussion on template talk:infobox person started by User:Pigsonthewing for further context and the testcases. it's possible that we could merge this parameter with the |plain=yes option, but I will need to investigate the use of that parameter to be certain. so this edit also adds a tracking category to find uses of |plain=yes. Frietjes (talk) 15:45, 22 August 2013 (UTC)
I think this might be a browser issue; e.g. I see the described behaviour whit Chrome (30.0.1599.14 dev-m), but not with Firefox (22). -- Michael Bednarek (talk) 15:25, 23 August 2013 (UTC)
For what it's worth, my wife's iPhone (I remain non-mobile, non-smart) shows the text unobscured, but I understand that its iOS can't play .ogg files anyway, so it's probably not worth very much. -- Michael Bednarek (talk) 05:49, 24 August 2013 (UTC)
That would be alright for me as a screen reader user, as long as the image syntax contained a title like "Help playing media" or something, using the same syntax as your Commons example. Graham8704:23, 9 March 2014 (UTC)
I would like to add an audio file to a podcast infobox using this template, but it seems this is not possible. When I attempt it, the audio file does not show up at all. I'm using the format used for inserting it into a person infobox. Is there some other way to do it? Mycota (talk) 14:31, 8 April 2014 (UTC)
I've just converted this template to use Module:Listen. This has removed the 10-file limit from the template, and should also speed up the template's rendering. Please let me know if you spot any bugs, or any behaviour that was different from the template version. — Mr. Stradivarius♪ talk ♪05:06, 3 June 2014 (UTC)
Thanks for checking. :) Yes, those pages can be deleted after the changes filter through the job queue, although it might be better just to redirect them to the template or the template sandbox so other editors can inspect the page history. — Mr. Stradivarius♪ talk ♪09:29, 3 June 2014 (UTC)
Ah, yes, that's a bug. Thanks for reporting it! Images supplied with |image= had file wikitext added to them, which meant that what should have been "none" as an argument to {{side box}} was in fact "[[File:none|65x50px|center|link=|alt=]]". I've fixed the module and it now seems to be working correctly. Let me know if you spot anything else. — Mr. Stradivarius♪ talk ♪03:20, 4 June 2014 (UTC)
@Graham87: Thanks for letting me know - for some reason I never actually implemented that parameter in the Lua module. I've added it now, and I've added a test case so that it won't get forgotten again. — Mr. Stradivarius♪ talk ♪11:26, 13 June 2014 (UTC)
I added subtitles to the clip of a song showcased in an article about the song. I can see the subtitles being displayed correctly and according to timing when I play the song in the subtitle page. But in the actual article, no subtitle is displayed at all. When clicked on the CC option, there is no new subtitle option visible.
I checked out the listen tag specifications but there is nothing about subtitles or closed captions. Although I noticed the clip of First words spoken on Moon has subtitles shown, there is no indication in the example on how to enable it. How can I make subtitles be shown when the audio file is played in the main article?
This problem appears to have been corrected now. Not sure what changed, or if there was some cache update delays on the server side or client side. The original reported problem is no longer reproducible in the linked pages.
When used in infoboxes, {{listen}} is often centered by use of obsolete <center>. It can be centered with |style=margin: 0 auto;, but this is confusing to editors. Please add an |align= parameter with the values:
How would I go about using this cool feature in my MediaWiki?
Hi there,
I've tried to work it out from the source but couldn't. Is this a standard MediaWiki extension? I'd love to have it working in my wiki. Thanks for any pointers! 91.125.85.186 (talk) 22:51, 20 June 2016 (UTC)
Since today, I've noticed this template has been reduced in width, or at least appeared to be when looking at articles using this template. Why? and how? I don't see anything in this template page's history to indicate a change. I don't really like the change if one has been made; especially with audio samples that have an accompanying captions, it looks very squeezed in and difficult to read, @Frietjes:. Dan56 (talk) 04:09, 1 July 2016 (UTC)
Apparently it was changed globally, since I noticed this change in Russian Wikipedia too. Seems like they removed current position slider, so that's why the whole player is smaller now. — GreatMusicLover (talk) 08:55, 1 July 2016 (UTC)
If it was a global change (and it seems like it was, just check interwiki of {{Listen}}), I'd guess "they" are the MediaWiki engine developers. But I don't know why this change was made. — GreatMusicLover (talk) 09:17, 3 July 2016 (UTC)
Why is width greater than it should be? It is breaking line with respect to the standard 220px image width (left side of the images is a bit indented when compared to the template listen). --Obsuser (talk) 11:26, 13 July 2016 (UTC)
@Michael Bednarek: Slider should get reduced in width, not template increased in width. Please consider the standard image width – 220px. Now it looks bad when there is a vertical array of images (separately displayed with File: etc.) and this template Listen among or below them; it breaks consistency as it pops out a bit more to the left if everything is aligned to the right. --Obsuser (talk) 16:10, 13 July 2016 (UTC)
The width was not arbitrarily chosen. The reason why the template juts out is because of the icon, which already has an "image" parameter that lets you remove it.
There should be some way to control the width. Another solution would be to reduce the size of the icon and position the "description" text below both elements.--Ilovetopaint (talk) 16:15, 15 July 2016 (UTC)
I guess default display style should have been adjusted to fit needs (as it is most widely used one). However, this is not the case... --Obsuser (talk) 17:35, 15 July 2016 (UTC)
Now the slider width corresponds to the image width, but generally it is still horrible. Check sr:Девојачка група to see what I'm talking about (it would be same on en.wiki and certainly there are similar cases here too). --Obsuser (talk) 23:40, 21 July 2016 (UTC)
It's weird for me. I see sr:Девојачка група as you describe it, back to the previous width and a progress slider, but only there, and on Commons. When I look at any {{Listen}} on the English Wikipedia, or some random transclusions on the SR Wikipedia (e.g. sr:Хелијум), I only see that its width is as previously (wider), but no progress slider (even after repeated purge/refresh). -- Michael Bednarek (talk) 10:17, 22 July 2016 (UTC)
It is because in sr:Девојачка групаmusic is defined as type parameter content. It's not important as much as fact that width in both/all cases (e.g. sr:Девојачка група and sr:Хелијум) is too big. I gave sr:Девојачка група as one good example (consistency is present—slider width matches standard image width—but I still do think that left part width i.e. speaker icon/image that pops out left to the left margin of the right centered image looks pretty bad [on all Wikipedias that use same formatting as English Wikipedia, including English Wiki itself]). --Obsuser (talk) 08:19, 24 July 2016 (UTC)
Empty template transclusions not detected
This edit request to Module:Listen has been answered. Set the |answered= parameter to no to reactivate your request.
I have no experience with Lua coding, but the code at Module:Listen below "-- Exit early if filename (required) is not provided." seems to prevent "function p.renderTrackingCategories" from ever executing in that case. -- Michael Bednarek (talk) 12:52, 16 June 2018 (UTC)
Yeah, the template adds the category not if the filename is not entered, but if the entered file doesn't exist (which I don't think is unreasonable). Nardog (talk) 12:58, 16 June 2018 (UTC)
Just would like to announce that I've created a new template, Template:Synthlisten, which is based on this one. While you can include a MIDI file in the Listen template, it does not actually allow playback within the browser (since MediaWiki does not render MIDI files in a way that allows them to be put in the standard ogg-media player). This template uses Timidity++ to render a MIDI to Ogg and then displays it to the user in a form that is playable in the browser. It's kind of hacky (you can see the source of Module:Synthlisten and Template:Synthaudio for more) but it works. D. Benjamin Miller (talk) 05:40, 1 August 2018 (UTC)
Not quote marks around song titles
The template doc tells you not to use quote marks around song titles. When the change was made, Pigsonthewing cited clarity of metadata and the fact that we don't use quote marks in section headings. Is there some actual, tangible way in which this would screw metadata (what is metadata from this template used for anyway)? Also, we do use quotation marks in section headings when they include names of minor works (songs), so that's a moot point.
Personally I'd go with Michael Bednarek's opinion that quotation marks would be better MOS:TITLE compliance. That seems to be the de facto consensus as well. I checked a dozen Featured Articles that use this template for songs, and all had quotation marks in the title. There was one exception, Frank Zappa, that had quotation marks for just some songs, i.e. "N-Lite" (1994), not the confusing N-Lite (1994). Using them for some, such as to avoid confusion, but not for all, introduces an inconsistency. The same is true with any article that uses song names in quote marks in prose but omits them in these templates.
Of course there ought to be quotation marks around song titles, for several reasons. Note that the occasion that Pigsonthewing quoted in 2010 contains quotation marks now. I'm going to restore the previous documentation. -- Michael Bednarek (talk) 05:55, 17 August 2018 (UTC)
CSS class
Would it be possible for the outermost table in this template to have a CSS class so it could be targeted by those writing userscripts or custom CSS? Currently it just has mbox-small and noprint, which aren't unique to this template. Opencooper (talk) 23:42, 13 July 2019 (UTC)
I'll await resolution of the discussion about the audio template before possibly actioning this request (unless somebody gets there before me), vut for the record, it seems like you want the change made to Module:Listen, not Template:Listen. Graham8703:01, 29 March 2020 (UTC)
240px: Look, a slider!233px: The smallest size which shows a slider.220px (as it's now) No slider :-(
For longer recordings, it would be really nice of one could include a slider, as in the example at the right (although it would be nice if using the slider did not unpause the music automatically). Thanks! HLHJ (talk) 20:05, 15 December 2019 (UTC)
I agree that such a slider would be useful. The easiest way to get it is to specify a thumbnail size of 233px in Module:Listen (instead of the current 220px). A better solution is to create a parameter to control the size, which should default to 233px. I don't think the small increase will cause any problems. -- Michael Bednarek (talk) 01:50, 16 December 2019 (UTC)
I have now added a crude way to use a new parameter |size= to the sandbox (see diff), defaulting to the current value of 220px. This works as a numbered parameter, similar to |filename=, |filename2= etc. I'd rather have a parameter that works for the entire template once, similar to |type= or |header=, but I wanted to test the waters first. As mentioned before, I'd also like to change the default value to 233px. -- Michael Bednarek (talk) 12:01, 30 April 2020 (UTC)
I can't see this being available at test.wikipedia.org, so where can this be tested? How long is its deployment away? I tried it in preview mode at mw:Extension:TimedMediaHandler/VideoJS Player, and for sound files it looks indistinguishable from the current player, including the presence or absence of a slider depending on >232 pixels. The template "Listen" does a lot of useful presentation stuff, so I don't see how it would become obsolete – it will just use a different player. Sizing the play button to have a slider showing will still need to be implemented in this template here. -- Michael Bednarek (talk) 10:29, 9 July 2020 (UTC)
I had an irrational fear of ticking that box. I've done it now, and the appearance is very different to what I saw at mw:. As far as sliders go, it's worse because there aren't any because the size of the button seems to fixed, whereas the buttons at mw: could be sized. This is far from ready, which still leaves a need to implement a parameter |size= here. -- Michael Bednarek (talk) 12:45, 9 July 2020 (UTC)
At Wikipedia:Help desk#Template:listen, Arch dude determined that the "bad" one has class .mbox-small-left while the "good" one has class .mbox-small, and that.mbox-small-left sets overflow:hidden
The recent addition to the Module:Listen/sandbox which implements showing the clip's time is generally a good thing, but there may be occasions where it's unwanted/unnecessary. For those, a parameter like |showtime=off should be provided.
Further, if the module is upgraded, a |size= should also be implemented, and some thought should be given to change the default size to 233px. -- Michael Bednarek (talk) 12:56, 9 January 2021 (UTC)
How about |length(n)=hide, so the duration can be turned off file-by-file? To your second point: I'd rather change it to 233px than implement a whole new parameter. Nardog (talk) 14:06, 9 January 2021 (UTC)
Of course it is much better to provide an (n)-based solution to display a file's duration. As for width: I'm fine with 233px, but others might not be, and I'm not sure about unintended consequences after so many years of 220px. -- Michael Bednarek (talk) 14:39, 9 January 2021 (UTC)
CSS class
Would it be possible for the outermost table in this template to have a CSS class so it could be targeted by those writing userscripts or custom CSS? Currently it just has mbox-small and noprint, which aren't unique to this template. Opencooper (talk) 22:03, 12 December 2020 (UTC) (note: this is a repost of an earlier request)
I'm not sure if this is the right place to ask this, but is there a way to make this template appear after the first paragraph in mobile view when placed at the top of articles, in the same way that images and infoboxes are? See, for example, https://en.m.wikipedia.org/wiki/King_Cotton_(march), in which the template is before the first paragraph. Mysterymanblue 22:07, 15 July 2021 (UTC)
@Michael Bednarek: Interesting. I guess the mobile app interface and the mobile web interface are handled differently. This is clearly a MediaWiki issue, not a local issue, so I have added a feature request here. Mysterymanblue 09:13, 16 July 2021 (UTC)
I did implement everything I added to the sandbox recently. If you're taking about showing the length, that was added in January, and I haven't implemented it precisely because you had some reservations about it. Nardog (talk) 18:12, 8 November 2021 (UTC)
You suggested then to add |length(n)=hide which indeed happened in the sandbox; so that's addressed. The other sandbox change, default width to 233px, looks almost unnoticeable in the test cases, with the significant bonus of a progress bar, so I think that should be implemented, too. -- Michael Bednarek (talk) 00:02, 9 November 2021 (UTC)
Is hiding the template efficient when a file gets deleted? I don't see a point of hiding the template from view but rather leave the template remaining in source. If a file gets deleted, I would like to remove the whole template if I want to. Is hiding the template a way to lead others into asking an undeletion of the file when editing a page? --George Ho (talk) 23:57, 13 February 2022 (UTC)
I'm sure it's because it has no benefit to the reader to serve them a box that does nothing. Bots that delink deleted files don't take into account the syntax of individual templates (and they shouldn't because the syntax can change anytime) and simply remove the filename, so it's better to hide it. When someone is manually delinking a deleted file, however, they should remove the transclusion (or the parameters if the transclusion contains other remaining files) altogether (if they can afford it). Nardog (talk) 00:07, 14 February 2022 (UTC)
Better belated than never reply. Anyways, Nardog, nonetheless, hiding deleted files relying on the template has also affected old revisions, like this one here. I have to click the "Edit" (or "Edit source") tab to find out the filename of a deleted file just to search for its history logs and pages linking to the deleted file. George Ho (talk) 08:01, 19 February 2022 (UTC)
I don't understand what your point is. If a file is deleted you should remove the empty template. The hiding is a tentative measure to prevent serving readers something useless to them. Nardog (talk) 08:25, 19 February 2022 (UTC)
Recent changes and timedtext
When media is given timedtext captions, the reader can no longer simultaneously scroll the article and listen to the media. I don't think this is an improvement. I'm not sure where this new change was made or how/if it can be modified. Any help? ili (talk) 14:15, 6 May 2022 (UTC)
Now that the media player shows the length for sound files, this template showing it, too, is no longer useful for those files. Maybe User:Nardog can remove that feature again. It would still be useful for video files, but I suspect the code is, and rightly so, agnostic about the file type. I don't think the template is used for many video files, so maybe the functionality could be flipped: don't show the duration unless |length(n)=yes. -- Michael Bednarek (talk) 04:32, 19 June 2022 (UTC)
The new player shows the duration for some videos too. It looks like it depends on the aspect ratio. We can make the length show only for videos. Should we? Nardog (talk) 17:49, 20 June 2022 (UTC)