This is a wiki for a reason. Anyone can contribute. If you see something that is inaccurate or can be improved, don't ask that it be fixed--just improve it.
[ Disclaimer, Create new user --- Wiki markup help, Install P99 ]

Difference between revisions of "Template:Youtube"

From Project 1999 Wiki
Jump to: navigation, search
(Example #2: Specific Dimensions)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This template allows you to embed a Youtube video in a page. Note that the URL must be an "embed" URL (ie. it should start with the Youtube URL, followed by "/embed/", then the video ID).
+
This template allows you to embed a Youtube video in a page.
 +
 
 +
== Important Note ==
 +
 
 +
The URL used ''must'' be an "embed" URL (ie. it should start with the Youtube URL, followed by "/embed/", then the video ID). You can get this URL by right-clicking on a Youtube video and choosing "Copy Embed Code".  This will copy code like:
 +
 
 +
<code><nowiki><iframe width="300" height="150" src="https://www.youtube.com/embed/CBttHicGbek" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></nowiki></code>
 +
 
 +
You want the URL inside the src="" part.  In other words, you want:
 +
 
 +
<code><nowiki><iframe width="300" height="150" src="</nowiki></code>'''https://www.youtube.com/embed/CBttHicGbek'''<code><nowiki>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></nowiki></code>
  
 
=== Example #1: Basic ===
 
=== Example #1: Basic ===

Revision as of 00:59, 23 October 2019

This template allows you to embed a Youtube video in a page.

Important Note

The URL used must be an "embed" URL (ie. it should start with the Youtube URL, followed by "/embed/", then the video ID). You can get this URL by right-clicking on a Youtube video and choosing "Copy Embed Code". This will copy code like:

<iframe width="300" height="150" src="https://www.youtube.com/embed/CBttHicGbek" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

You want the URL inside the src="" part. In other words, you want:

<iframe width="300" height="150" src="https://www.youtube.com/embed/CBttHicGbek" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Example #1: Basic

{{youtube | https://www.youtube.com/embed/CBttHicGbek}}

Loading Video ...

Example #2: Specific Dimensions

{{youtube | url= https://www.youtube.com/embed/CBttHicGbek | height=400 | width=400 }}

Loading Video ...