Template:YoutubePlayer

undefined

How to use


}} NOTE: The  parameter negates the   and   parameters when set to 1, meaning there won't be a noticeable gap in the page when in use. Also be aware that setting the  and/or   parameters too low may prevent autoplay functions from working.
 * PlaylistURL = (the video ID, located after watch?v=, followed by playlist ID if a playlist is desired)
 * Autoplay = (0 = Doesn't Autoplay, 1 = Autoplay; defaults to 0)
 * Hide = (0 = Visible, 1 = Hidden; defaults to 0)
 * Loop = (0 = Doesn't Loop, 1 = Loop; defaults to 0)
 * Single = (0 = Playlist, 1 = Single video/track; defaults to 1)

Single videos/tracks
Despite the parameter for the video ID being called, YoutubePlayer supports single videos and music tracks by default. To display a single video or music track, the following code must be used: 

It's up to you if you want to use the other parameters (, , etc.) or not; the   parameter can technically be omitted as it defaults to 1 anyway, though if you do include it, it must be set to 1, else strange behaviour happens, particularly when used in conjunction with the 'loop' parameter.

Playlists
A great feature of YoutubePlayer is its ability to support playlists as opposed to just single videos and music tracks. To display a playlist, the following code must be used: 

As with single videos and music tracks, parameters such as  and   are optional, though having   set to 0 does not prevent the playlist from switching video/track automatically. It is possible to use &index= in conjunction with a switch function to randomise the first video/track that plays, like so: 

The value specified after  refers to the amount of IDs in the switcher, where in this example, there are 10.

Credits
HTML and method to make this work originally found at the Russian Terraria Wiki. A similar script is available at the Wikia Developers Wiki, complete with installation instructions.