Template:VideoGallery/doc

From Dolphin Emulator Wiki
< Template:VideoGallery
Revision as of 22:40, 14 November 2012 by Mbc07 (talk | contribs) (Added documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This template uses the embed video plugin to randomly select 3 videos from a predefined list and show them as thumbnails. The rest of the videos are returned as plain text links (throught the call of a variable).

Usage

The video gallery template should be called in the following way:

  • {{VideoGallery|<number of videos>
|vid1=<video ID>|cap1=<title>|srv1=<service>
|vid2=<video ID>|cap2=<title>|srv2=<service>
|vid3=<video ID>|cap3=<title>|srv3=<service>
...
|vidN=<video ID>|capN=<title>|srvN=<service>
}}

where

  • Number of videos should be the number of video entries. N also should be always equal to this parameter.
  • Video ID is the ID of the video that you are embedding (like the bold part in this URL: http://www.youtube.com/watch?v=VqNcksMfAjM).
  • Title (optional) is the caption for the video. If no caption is entered or if the parameter is omitted, the template will return the video URL as title.
  • Service (optional) can be used to override the host site for that video, the default is YouTube.

Examples

  • We have 12 videos and their corresponding IDs and title. So, <Number of videos> should be 12. Then, every video ID and the corresponding title goes in one line:

{{VideoGallery|12
|vid1=sam9lDWDvXE|cap1=Xenoblade JP HD Gameplay 1A (Dolphin Emulator @ 720p)
|vid2=vKjjS8SRG9I|cap2=Xenoblade JP HD Gameplay 1B (Dolphin Emulator @ 720p)
|vid3=f_0IbQrezTo|cap3=Xenoblade JP HD Gameplay 2 (Dolphin Emulator @ 720p)
|vid4=_an7OMeK2nA|cap4=Xenoblade JP HD Gameplay 3 (Dolphin Emulator @ 720p)
|vid5=wjzv0KtDXOA|cap5=Xenoblade JP HD Gameplay 4 (Dolphin Emulator @ 720p)
|vid6=tJtCp8rPXWg|cap6=Xenoblade PAL HD Intro (Dolphin Emulator @ 1080p)
|vid7=_VLNa9PKT0Y|cap7=Xenoblade PAL HD Gameplay 1 (Dolphin Emulator @ 720p)
|vid8=dp3QnvFn_Hc|cap8=Xenoblade PAL HD Gameplay 2 (Dolphin Emulator @ 720p)
|vid9=EzSDE3NOq_Y|cap9=Xenoblade PAL HD Gameplay 1 - Near start of game (Dolphin Emulator @ 720p)
|vid10=oGcSdu3t8CQ|cap10=Xenoblade PAL HD Gameplay 2 - Continuation of Gameplay 1 (Dolphin Emulator @ 720p)
|vid11=5Ywd5T5y91E|cap11=Xenoblade PAL HD - A protective mother (Dolphin Emulator @ 720p)
|vid12=3Fvdc_LuWB4|cap12=Xenoblade Intro HD 1080p (Dolphin)
}}

The above example produces this:

Please note that the remaining videos that haven't been chosen aren't here. Part of the functionality of this script is adding a list with links to the other videos that are available, and this list can be "embedded" in any part of the page by using the command {{#var:videolinks}}. In the place that you call the videolinks variable you get this:


Notes

  • This template should be used ONLY if the page that you pretend including this have more than 3 video links. Calling this template with less than 3 videos are prone to cause a lot of parser errors in the page that included this template
  • At moment YouTube is the only service supported, so the entry |srvN= should ALWAYS be omitted, and the template will automatically fall back to YouTube. Trying to use other services that hadn't been implemented yet will just return you a red link to a template that doesn't exist.
  • Every time that you access or refresh the page, you'll randomly get another 3 video thumbnails.
  • If you want to add more content after calling the template, you should use a <div style="clear:left"></div> right after embedding this template to avoid any issue you could get with floating elements.