Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
DOORS Site Logo

Welcome to the Official DOORS Wiki!
Please read the Wiki Rules the Manual of Style and familiarise yourself with our Wiki Policies before contributing to get a better understanding of what content is allowed on our wiki and how to display it properly, if you need help don't hesitate to reach out to a DOORS Wiki Staff Member.

Template:Audio/doc

Template page
< Template:Audio
Revision as of 21:57, 1 June 2024 by Unavailablehoax (talk | contribs) (Create /doc subpage for Template:Audio)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This template enhances the regular audio embed with automatic fallback using multiple <source> elements, no preloading for faster load times, and no download option. Uses HTML5AudioPlayer.

To use, replace any regular audio embed with this template. For example, [[File:Elevator Jam.ogg]] can be replaced with {{Audio|Elevator Jam}}. When played, it tries to play File:Elevator Jam.ogg, falling back to File:Elevator Jam.ogg.mp3 if OGG files cannot be played in the current browser.

Usage

{{Audio|1|2|no-fallback=|allow-preload=}}

Parameters

No description.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Primary audio file1

Name of the primary audio file. If there is no file extension, then .ogg is automatically appended.

Stringrequired
Fallback audio file2

Name of the audio file to be played when the primary one fails. By default, this is the primary file with .mp3 appended.

Default
<primary audio file>.mp3
Stringoptional
Disable fallback?no-fallback

Disables the fallback functionality. Use if the primary audio file is not an OGG file.

Booleanoptional
Allow preloading?allow-preload

Allows the audio to be embedded when custom JavaScript is not available, like on mobile devices, at the expense of slower load times. Use if the page has a few audio files or if the audio files are small.

Booleanoptional

Examples

Template code Generates
Typical usage
{{Audio|Elevator Jam}}
Play (MP3) }}{{#var: audio-no-js-text}}
MP3 file
{{Audio|File:DOORS Trailer Theme Extended.mp3|no-fallback=1}}
Play }}{{#var: audio-no-js-text}}
Preloading allowed
{{Audio|Item Shimmer|allow-preload=1}}
Play (MP3) }}{{#var: audio-no-js-text}}