Issue with Audio template and Html5mediaAudio widget on Mediawiki v1.34 ...

Skip to first unread message

J Harkins

Jul 22, 2020, 9:57:34 PM7/22/20
to MediaWiki Widgets
I have added the Audio template to a mediawiki v1.34 instance along with the Html5mediaAudio widget; however, I am unable to use the Audio template with either a remote or local file as described on the guide page. Instead, I see a transport control with a play icon followed by the word "Error" (this using safari - see first image) and in chrome I see a grey transport control with no audio to play (0:00 - see second image). When using the widget alone (without the audio template), it works as intended using a remote url. Can someone verify that the suggested audio template continues to function with the widget? Thanks.

Safari browser result:Screen Shot 2020-07-22 at 7.36.49 PM.png

Chrome browser result (this control is greyed out despite a valid audio file in the template)Screen Shot 2020-07-22 at 7.37.12 PM.png


Dec 13, 2021, 4:45:05 AM12/13/21
to MediaWiki Widgets
I can confirm the same issue on mediawiki 1.37. I don't understand the syntax of the templates so I can't give any deep insight, however I can leave you with a fix I've found for both this and the identical issue with the Video widget, I apologize for the necro but hope this helps someone.
the workaround I found for the Audio widget was to simply bypass the template and just pass it a resolved url (as opposed to a name)
for video I edited my video template to this (it works even if you don't have an ssl cert):
 |url={{#if: {{{url|}}} |{{{url|}}} |https:{{filepath: {{{name|}}} }} }}
in theory this shouldn't change anything but that makes it work somehow... if you dislike jank you can just do the same thing as I did for audio and skip the templates.
Message has been deleted

Dec 13, 2021, 4:10:25 PM12/13/21
to MediaWiki Widgets
Hi and thanks for following up. I spent some time investigating this issue after my post long ago and, while I did find a solution to the original problem, I also discovered additional issues with the widget which are discussed here:

So ultimately I think the best course is to avoid this widget in favor of contemporary alternatives. However, for the sake of completeness, the solution I found to get the widget to behave better seemed to have something to do with surrounding the template code with the <includeonly> tag. So what worked for me was creating the template as follows:

 |url={{#if: {{{url|}}} |{{{url|}}} |{{filepath: {{{name|}}} }} }}

Note that this does not resolve the issue where enclosing an ogg file in this template produces very undesirable results through browsers that have no native ogg support.

Best wishes.

ps. deleted original reply due to problem expressing code in code block. Seems to be no way to edit or preview a post in this forum so delete and repost it is.

Dec 13, 2021, 4:13:47 PM12/13/21
to MediaWiki Widgets
ok - still seems to be an issue with the forum recognizing a code block in my post but the template description above should not include the surrounding code tags. Gotta love Google :(.
Reply all
Reply to author
0 new messages