Embedding YouTube Videos

moodleIn any part of your Moodle site, where you can edit content, there is an opportunity to embed a YouTube video.  This article describes the procedure.

Get the Embed Code

Start by visiting YouTube, and browsing to the video that you want to embed.

  1. Click the Share button.
  2. Click the Embed tab.
  3. Copy the text, it should look something like this...
<iframe width="560" height="315" src="//www.youtube.com/embed/vXP5S0Zb5EY" frameborder="0" allowfullscreen></iframe>

If you'd like to remove the name information and prevent related videos showing at the end you could use the following code...

<iframe src="//www.youtube.com/embed/vXP5S0Zb5EY?rel=0&amp;showinfo=0" allowfullscreen="" frameborder="0" height="240" width="428"></iframe>



Log in to your Moodle site, and enter any editable area...

  1. Click the Show more buttons button.
  2. Click the HTML button.
  3. Paste the embed text that you copied from YouTube. 

It's a good practice to adjust the height and width to suit your current theme.  For the Clean theme I changed to height="240" width="426")


Thanks for visiting.