Embed videos & playlists
You can add a YouTube video or playlist to a website or blog by embedding it.
Embed a video
- On a computer, go to the YouTube video you want to embed.
- Under the video, click SHARE .
- Click Embed.
- From the box that appears, copy the HTML code.
- Paste the code into your blog or website HTML.
Embed a playlist
- Sign in to your YouTube account on a computer.
- On the left side of the page, select the playlist you want to embed.
- Copy the playlist ID from the URL.
- 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:
Manage video embedding options
Turn on privacy-enhanced mode
Privacy Enhanced Mode allows you to embed YouTube videos without using cookies that track viewing behavior. This means viewing inbox isn’t collected to personalize 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 behavior, not ads-serving behavior. 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 behavior as per that website’s 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
After
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 autoplay, 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 autoplayed don't increment video views.
Example:
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:
Add captions to an embedded video
Make captions automatically appear for 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 2-letter language codes in the ISO 639-1 standard.
Turn off embedding for your videos
- Go to your Video Manager.
- Go to the video you want to turn off embedding for and click Edit.
- Under the video, click Advanced settings.
- Under "Distribution Options," uncheck the Allow embedding checkbox.
- Click Save changes.
* Nguồn: Youtube