Difference between revisions of "Widget:Trailer"
Jump to navigation
Jump to search
(WIP) |
|||
(9 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
=== Parameters === | === Parameters === | ||
− | ; id : The YouTube ID of the video to play. This can be found in the URL (i.e., <nowiki>https://www.youtube.com/watch?v=</nowiki><b> | + | ; id : The YouTube ID of the video to play. This can be found in the URL (i.e., <nowiki>https://www.youtube.com/watch?v=</nowiki><b>a_FfU6nBQH8</b>) |
; playlist : The YouTube PlayList to play. Only specify an ID or a PlayList. | ; playlist : The YouTube PlayList to play. Only specify an ID or a PlayList. | ||
; height / width : Height and width of the map pane, in pixels. Default is 430 x 242 | ; height / width : Height and width of the map pane, in pixels. Default is 430 x 242 | ||
Line 9: | Line 9: | ||
[[Category:Widgets]] | [[Category:Widgets]] | ||
− | </noinclude><includeonly><style>.youtube img{-webkit-transition: opacity 0.5s ease;transition: opacity 0.5s ease;} .youtube img:hover{opacity: 0.5;}</style><div class="youtube" onclick="this.style.display='none'; this.nextElementSibling.style.display='block'; document.getElementById(' | + | </noinclude><includeonly><style>.youtube img{-webkit-transition: opacity 0.5s ease;transition: opacity 0.5s ease;} .youtube img:hover{opacity: 0.5;}</style><div class="youtube" onclick="this.style.display='none'; this.nextElementSibling.style.display='block'; document.getElementById('youtube_video').setAttribute('src', 'https://www.youtube.com/embed/<!--{if isset($playlist)}-->?listType=playlist&list=<!--{$playlist|escape:'urlpathinfo'}--><!--{else}--><!--{$id|escape:'urlpathinfo'|default:'a_FfU6nBQH8'}--><!--{/if}-->?autoplay=1');" style="width:<!--{$width|escape:'html'|default:'430'}-->px;height:<!--{$height|escape:'html'|default:242}-->px;background-image: url('<!--{$placeholder|escape:'urlpathinfo'|default:'https://underwiki.com/images/5/58/Trailer.png'}-->');background-size:<!--{$width|escape:'html'|default:'430'}-->px <!--{$height|escape:'html'|default:242}-->px"><img width="<!--{$width|escape:'html'|default:'430'}-->" height="<!--{$height|escape:'html'|default:242}-->" src="https://underwiki.com/images/9/90/Play.png" /></div><div class="youtube_player" style="display:none"><iframe id="youtube_video" style="width:<!--{$width|escape:'html'|default:'430'}-->px;height:<!--{$height|escape:'html'|default:242}-->px;border:0;" allowfullscreen="allowfullscreen" mozallowfullscreen="mozallowfullscreen" msallowfullscreen="msallowfullscreen" oallowfullscreen="oallowfullscreen" webkitallowfullscreen="webkitallowfullscreen"> </iframe></div></includeonly> |
− |
Latest revision as of 12:40, 20 June 2019
This widget is used to embed the YouTube trailer.
Parameters
- id
- The YouTube ID of the video to play. This can be found in the URL (i.e., https://www.youtube.com/watch?v=a_FfU6nBQH8)
- playlist
- The YouTube PlayList to play. Only specify an ID or a PlayList.
- height / width
- Height and width of the map pane, in pixels. Default is 430 x 242
- placeholder
- URL of the image to show before playing.