Embed a YouTube video

In Moodle, all HTML is treated equally, so this tutorial applies to web page elements, HTML blocks, and any other location where the HTML Editor is present. First thing to do is get the embed code for the video from YouTube. Go to the video's page and look at the area below the video. You will see some info about the author and a description of the video. 

You will also see an area labeled "Share". By clicking this tab a new area will pop up below.

YouTube

Once you click the Share tab you should see a new set of buttons with one labeled "Embed".  Click the Embed tab:


YouTube

After clicking Embed, another area below the Embed tab will open to reveal the code you need to show a video in your course.  It should look similar to the information above. Now you only need to copy and paste this into your course.

Click the "Copy" button on the bottom right side of the embed popup screen.
copy button




Now you are ready to paste the code into an HTML element in Moodle. Navigate to the edit area of the element where the HTML Editor exists.

Important: Before adding your Embed code, be sure to enter some text in the editor for the video. Below, 'Sample Video' is entered. Otherwise, the Page will not save.

YouTube

Click the "< >" button on the editor. This will pop up a code editor. Now paste the code into the box by clicking in the box and pasting the code in using either a keyboard shortcut or the right mouse click menu. If you are comfortable with keyboard shortcuts, use the key combination of Ctrl + V or command + V key on an Apple Macintosh to paste the code. If you would rather use the mouse right click the mouse on the selected code. A subtext menu will appear. Click "Paste".

YouTube


You should now see the code in the editor like this. Scroll to the bottom of the box and click "Update". You should now see the editor again, with the YouTube player displayed:
YouTube
Now, scroll to the bottom of the page and click "Save and display".
Last modified: Friday, 27 March 2020, 1:40 PM