Minecraft Wiki
Sem resumo de edição
Sem resumo de edição
Linha 1: Linha 1:
<span class="sound"><span class="sound-title">{{{1}}}</span>{{#if: {{{nofallback|}}} | <span style="display:none"> }}[[File:{{{2}}}|class=sound-audio]]{{#if: {{{nofallback|}}} | </span> }}</span><!--
+
<includeonly><span class="sound"><span class="sound-title">{{{1}}}</span>{{#if: {{{nofallback|}}} | <span style="display:none"> }}[[File:{{{2}}}|class=sound-audio]]{{#if: {{{nofallback|}}} | </span> }}</span><!--
   
 
-->{{#vardefine: i | 3 }}{{#while:
 
-->{{#vardefine: i | 3 }}{{#while:
Linha 5: Linha 5:
 
| <span class="sound"><span class="sound-title"></span><span style="display:none">[[File:{{{ {{#var: i}} }}}|class=sound-audio]]</span></span><!--
 
| <span class="sound"><span class="sound-title"></span><span style="display:none">[[File:{{{ {{#var: i}} }}}|class=sound-audio]]</span></span><!--
 
-->{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }}
 
-->{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }}
}}<noinclude>
+
}}</includeonly><noinclude>
 
{{documentation}}
 
{{documentation}}
 
<!-- Put categories/interwiki on the documentation page -->
 
<!-- Put categories/interwiki on the documentation page -->

Edição das 20h26min de 4 de dezembro de 2019

[ver | editar | histórico | purgar]Documentação

This template is used to provide a button to play a sound effect, with a HTML audio player as a fallback if JS is disabled. This is intended primarily for short sound effects, as there is no seeking ability.

The script and styles are provided by the sound gadget (MediaWiki:Gadget-sound.js, MediaWiki:Gadget-sound.css, MediaWiki:Gadget-sound-styles.css), with a fallback style in the site gadget (MediaWiki:Gadget-site-styles.css).

Usage

  • |1= is the displayed wikitext. A speaker icon is displayed next to it indicating the playing status. Clicking the text (if not a link) or icon will stop any other sounds, and start/stop this sound.
  • |2= is the name of the audio file to play
  • |nofallback= hides the fallback audio player, so the sound can only be played if JS and the sound gadget is enabled. This is good for placing the sound button inline with text, as the fallback audio player is not inline, and would otherwise be too big to include within a sentence. In this case, you should set the displayed text to be a link to the file so it can still be played by no-js users and users which disabled the sound gadget.

Examples

(Disable the sound gadget to see how the fallback looks)

Basic
{{sound|Play my mixtape 🔥|Calm4.ogg}}

Play my mixtape 🔥


Inline with a link instead of a fallback player
{{sound|'''[[Media:HerobrinePronunciation.ogg|Herobrine]]'''|HerobrinePronunciation.ogg|nofallback=1}} is the subject of a community-made [[wikipedia:Creepypasta|creepypasta]].

Herobrine is the subject of a community-made creepypasta.


In an infobox
{{Entidade
|sounds=
* {{sound|'''Idle'''|Parrot idle.ogg}}
* {{sound|'''Eat'''|Parrot eat.ogg}}
* {{sound|'''Fly'''|Parrot fly.ogg}}
* {{sound|'''Step'''|Parrot step.ogg}}
* {{sound|'''Hurt'''|Parrot hurt.ogg}}
* {{sound|'''Death'''|Parrot death.ogg}}
}}

[ver | editar | histórico | purgar]A documentação acima é transcluída de Predefinição:Sound/doc.