1. Home
  2. New Starters
  3. Adding Resources
  4. How do I embed YouTube videos in Moodle?

How do I embed YouTube videos in Moodle?

Known issue: We are aware of an issue that prevents YouTube videos from shown in email notifications from forum discussions and we are investigating.

Teachers with editing access in a Moodle course, can embed YouTube videos using the Atto editor.

  1. Edit the Moodle Page, Label or Book chapter, where you want to embed the YouTube video.
  2. Click the arrow from the top left of the Atto editor.
  3. Click the HTML icon from the bottom row.
  4. Copy and paste HTML code below:
<div class="container">
<div class="embed-responsive embed-responsive-16by9">
    <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/paste-the-YouTube-video-ID-here" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
</div>
</div>
  1. Find the YouTube link of the video you want to add to Moodle and copy the random alphanumeric characters that appear after the = sign.

Example

If the link is https://www.youtube.com/watch?v=UjaJsgC3q0A, then only copy UjaJsgC3q0A.

  1. Return to the code you pasted in Moodle (step 4), delete the sentence paste-the-YouTube-video-ID-hereand paste the alphanumeric ID you copied in Step 5 right after /.
  2. Save changes.

Note: We don’t recommend copying and pasting the YouTube link directly in the editor, as this may result in an embedded video that doesn’t adapt to smaller screens, such as on phones and tablets.

Updated on August 18, 2020

Was this article helpful?