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

Template:Audio: Difference between revisions

Template page
m (update to work with Gadget-OggPlayer)
m (testing and tooltips)
Line 1: Line 1:
<includeonly>{{#if:{{{file|}}}|
<includeonly>{{#if:{{{file|}}}|
{{#ifeq:
{{tt|
  {{lc:{{#explode:{{{file}}}|.|-1}}}}|ogg|
  {{#ifeq:
  <span class="audio-button">[[Media:{{{file}}}|{{{caption|Play}}}]]</span>
    {{lc:{{#explode:{{{file}}}|.|-1}}}}|ogg|
  |{{#sub:{{file:{{{file}}}}}|7}}
    <span class="audio-button">[[Media:{{{file}}}|{{{caption|Play}}}]]</span>
}}
    |{{#sub:{{file:{{{file}}}}}|7}}
  }}|[[:File:{{{file|}}}]]|line=false}}
}}</includeonly><noinclude>
}}</includeonly><noinclude>
This template displays a play/pause button for ogg files, and a "Play" link for non-ogg audio files.
This template displays a play/pause button for ogg files, and a "Play" link for non-ogg audio files.
Line 19: Line 20:


{{Audio|file=BlazBlue Central Fiction Jubei Battle Voice VS Celica 001.ogg}}
{{Audio|file=BlazBlue Central Fiction Jubei Battle Voice VS Celica 001.ogg}}
{{Audio|file=BlazBlue Central Fiction Jubei Battle Voice VS Celica 002.ogg}}
{{Audio|file=BlazBlue Central Fiction Jubei Battle Voice VS Celica 003.ogg}}


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 18:01, 15 March 2020

This template displays a play/pause button for ogg files, and a "Play" link for non-ogg audio files.

Usage

{{Audio
|file=filename without the File: prefix (e.g. BlazBlue Central Fiction Jubei Battle Voice VS Celica 001.ogg)
|caption=optional caption for non-ogg audio links. The link will display as "Play" by default
}}

{{Audio|file=BlazBlue Central Fiction Jubei Battle Voice VS Celica 001.ogg|caption=Caption}}