Template:Audio
Revision as of 03:56, 19 April 2019 by Riot Hero (talk | contribs) (Created page with "<noinclude> <div style="float: right">__TOC__</div> == Description == This is the '''Audio''' template. It uses the Html5mediaAudio widget but helps...")
Description
This is the Audio template. It uses the Html5mediaAudio widget but helps to avoid adding the full URL of a locally uploaded file to the widget's "url
" parameter by rather just specifying the name of the file via the "name
" parameter. It is however still possible to use the "url
" parameter for an externally hosted file.
Usage
externally hosted file
{{Audio |url=https://upload.wikimedia.org/wikipedia/commons/5/5c/Wagner_Tristan_opening_(orchestral).ogg }}
locally hosted file
{{Audio |name=Wagner_Tristan_opening_(orchestral).ogg }}
Example
externally hosted file
locally hosted file
Code
Just copy the following code to a page called "Template:Audio" on your wiki.
<includeonly>{{#widget:Html5mediaAudio |url={{#if: {{{url|}}} |{{{url|}}} |{{filepath: {{{name|}}} }} }} }}</includeonly>