(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 (Unavailablehoax moved page Template:Audio to User:Dhani irwanto/Audio without leaving a redirect: Unused; moving to userspace to make way for User:Unavailablehoax/sandbox) |
(No difference)
|
Revision as of 00:41, 22 May 2024
Loading
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 <div class="html5audio">
) or the barebones file format (the one with [[File:]]
).
Template:Warningbox
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.