(Created page with "<span class="html5audio flex-container" style="clear: both; justify-content: {{{align|right}}}" data-file="{{#explode:{{filepath:{{{file|Level 37 Ambience.mp3}}}}}|/r}}" data-volume="{{{volume|0.1}}}" data-download="false" data-preload="metadata" data-options="{{#ifeq:{{{autoplay}}}|no||autoplay}},{{#ifeq:{{{loop}}}|no||loop}}">{{{secrettext|Loading}}}</span><span style="display: none">[[File:{{{file|Level 37 Ambience.mp3}}}]]</span><noinclude><span style="margin-bottom:...") Tag: 2017 source edit |
m (Commented out missing template call.) |
||
(One intermediate revision by one other user not shown) | |||
Line 6: | Line 6: | ||
===Customizable Audio Template=== |
===Customizable Audio Template=== |
||
This is a very simple, highly customizable audio template, offering more optimization and convenience over inserting audio in the conventional html5audio class normally (the one with <code><nowiki><div class="html5audio"></nowiki></code>) or the barebones file format (the one with <code><nowiki>[[File:]]</nowiki></code>). |
This is a very simple, highly customizable audio template, offering more optimization and convenience over inserting audio in the conventional html5audio class normally (the one with <code><nowiki><div class="html5audio"></nowiki></code>) or the barebones file format (the one with <code><nowiki>[[File:]]</nowiki></code>). |
||
{{Warningbox|color=red|content='''Important: Using the html5audio class will normally mark the file as 'unused', like happens when the file truly is not used anywhere. This means that it will automatically be deleted when unused files are regularly cleaned. To avoid this, you should use this template.'''}} |
<br/><!--{{Warningbox|color=red|content=--><span class="error">'''Important: Using the html5audio class will normally mark the file as 'unused', like happens when the file truly is not used anywhere. This means that it will automatically be deleted when unused files are regularly cleaned. To avoid this, you should use this template.'''</span><!--}}--> |
||
Parameters: |
Parameters: |
Latest revision as of 06:12, 2 October 2024
Loading
Customizable Audio Template[edit | edit source]
This is a very simple, highly customizable audio template, offering more optimization and convenience over inserting audio in the conventional html5audio class normally (the one with <div class="html5audio">
) or the barebones file format (the one with [[File:]]
).
Important: Using the html5audio class will normally mark the file as 'unused', like happens when the file truly is not used anywhere. This means that it will automatically be deleted when unused files are regularly cleaned. To avoid this, you should use this template.
Parameters:
align
- Where the audio player will show up. Formatting is eitherleft
,center
, orright
. Default: rightfile
- This is where you insert the name and type of the audio file to use. Formatting isname.type
, likesong.ogg
. Default: Level 37 Ambience.mp3volume
- The volume of the audio played. Formatting is any value from 0 to 1, with 0 being 0% volume (muted) and 1 being 100% volume (maximum volume). Default: 0.1 (10% volume)autoplay
- Determines whether or not the audio should automatically start playing after the page loads. Set tono
if you don't want the audio to autoplay. Default: yesloop
- Determines whether or not the audio should automatically start playing again after ending. Set tono
if you don't want the audio to loop. Default: yessecrettext
- Sets some text that will briefly display before the audio file loads. Default: Loading
An example of how this template may be configured:
{{Audio|align=left|file=Critical.mp3|volume=0.5}}
- Result: Level Critical's audio will play at 50% volume, with the audio player showing up at the left side of the page. As autoplay, loop, and secrettext aren't set, they'll be at their default values, which means the audio will autoplay and loop, in addition to displaying the text Loading
shortly before the audio loads.