Embed videos & playlists

You can add a YouTube video or playlist to a website or blog by embedding it.

Subscribe to our YouTube Help channel to get the most out of YouTube.

Embed a video

  1. On a computer, go to the YouTube video that you want to embed.
  2. Under the video, click SHARE Share.
  3. Click Embed.
  4. From the box that appears, copy the HTML code.
  5. Paste the code into your blog or website HTML.

Embed a playlist

  1. Sign in to your YouTube account on a computer.
  2. On the left side of the page, select the playlist you want to embed.
  3. Copy the playlist ID from the URL.
  4. Modify the embed code for an individual video by doing the following:
    • In the place of the video ID (after 'embed/'), substitute 'videoseries?list='.
    • Then paste the playlist ID after the '='.
    • Paste the code into your blog or website HTML.

Example:

  • <iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLx0sYbCqOb8TBPRdmBHs5Iftvv9TPboYG" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

Manage video embedding options

Turn on privacy-enhanced mode

Privacy-enhanced mode allows you to embed YouTube videos without using cookies that track viewing behaviour. This means that viewing of embedded videos isn't collected to personalise the viewing experience. Instead, video recommendations are contextual and related to the currently played video. Videos playing in a privacy-enhanced mode embedded player won't influence the viewer's browsing experience on YouTube.


(The privacy-enhanced mode only relates to tracking of viewer behaviour, not ad-serving behaviour. To disable tracking for advertising purposes, you can add yourself to the Tag for child-directed treatment page.)

Note:

  • If the viewer clicks or taps out of the embed and is redirected to another website or app, that website or app may track the viewer's behaviour as per that website or app's policies and terms.
  • Privacy-enhanced mode is currently available only for embedded players on websites. Developers will have to wrap the privacy-enhanced mode player into a web-view instance in order to use it in apps.

To use privacy-enhanced mode, change the domain for the embed URL in your HTML from https://www.youtube.com to https://www.youtube-nocookie.com as shown in the following example:

Before
<iframe width="1440" height="762" 
src="https://www.youtube.com/embed/7cjVj1ZyzyE"
frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

After
<iframe width="1440" height="762" src="https://www.youtube-nocookie.com/embed/7cjVj1ZyzyE"
frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

Since this is a different domain, network administrators also need to add the domain youtube-nocookie.com to their firewall whitelist in addition to youtube.com.

Make an embedded video play automatically

To make an embedded video auto-play, add '&autoplay=1' to the video's embed code right after the video ID (the series of letters that follows 'embed/').

Embedded videos that are auto-played don't increment video views.

Example:

<iframe width="560" height="315"
src="https://www.youtube.com/embed/D6Ac5JpCHmI?&autoplay=1"frameborder="0" 
allowfullscreen></iframe>
Start an embedded video at a certain time

To have a video start playing from a specific point, add "?start=" to a video's embed code, followed by the time in seconds at which you'd like the video to begin playing.

For example, if you want a video to start at 1 minute and 30 seconds into the video, your embed code would look something like this:

<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/UkWd0azv3fQ?start=90" width="420"></iframe>
Add captions to an embedded video

Make captions automatically appear on an embedded video by adding "&cc_load_policy=1" to the video's embed code.

You can also choose a caption language for the embedded video. To specify the caption language for the video that you'd like to embed, just add "&cc_lang_pref=fr&cc_load_policy=1" to the video's embed code.

  • "cc_lang_pref" sets the language for the captions shown in the video.
  • 'cc_load_policy=1' turns captions on by default.
  • "fr" represents the language code for French. You can look up two-letter language codes in the ISO 639-1 standard.
Turn off embedding for your videos
If you've uploaded a video and don't want to allow others to embed your video on external sites, follow these steps:
  1. Go to your Video Manager.
  2. Go to the video that you want to turn off embedding for and click Edit.
  3. Under the video, click Advanced settings.
  4. Under 'Distribution Options' untick the Allow embedding tick box.
  5. Click Save changes.
Was this article helpful?
How can we improve it?