WSU Technology Knowledge Base:Embedding YouTube Movies

From WSU Technology Knowledge Base
Jump to navigation Jump to search
Wiki Author Series
Author series pic.jpg
This article is part of the

Wiki Author Series

Overview

There is a widget installed on our wiki that allows you to embed YouTube content into an article by inserting a special bit of code. This code can be entered anywhere in the article, including inside table cells, to place the movie in the desired position. Both individual YouTube movies and YouTube playlists can be embedded. To embed YouTube content, you need its unique YouTube ID. Every piece of content uploaded to YouTube has a unique ID, typically a string of letter and numbers. This ID is always visible in the YouTube URL. You can also get to it by selecting the Share button underneath the movie in YouTube. Copy that ID and paste it into the code below to embed the movie. Embedding a playlist is pretty much the same operation except you need the unique playlist ID.

Embedding a Single YouTube Movie

Embedding a single video inline using the following code results in the following video:

{{#widget:YouTube|id=y8Kyi0WNg40}}

Dimensions

Height and width dimensions can be added. The default size is 420x350. If no dimensions are specified, this default size is applied. I tend to use 608x402.

{{#widget:YouTube|id=y8Kyi0WNg40||height=402|width=608}}

Start time

You can also specify a start time in seconds. The video will then start that many seconds in.

{{#widget:YouTube|id=y8Kyi0WNg40|start=3}}

Embedding a YouTube Playlist

The code...

{{#widget:YouTube|playlist=PL0BCC4C34C61204A3}}

Generates the following embedded video:

Notes

Playlists are collections of YouTube movies that play in sequential order and allow viewers to select any movie in the collection. Playlists are established within YouTube by the channel owner. Every playlist has a unique ID, separate from the individual movie IDs.

Related Links