YouTube is one of the most popular video platforms on the web with over a billion views every day. But, you will also find YouTube videos on many other websites, using the embed feature. And, if you are looking to embed a YouTube video in your site, then there are a number of parameters that allow you to embed the video the way you choose. The parameters allow you to autoplay, show/hide controls, disable full screen, and so on.
Get the embed code from YouTube
- Browse to the YouTube video that you want to embed or share.
- Click the Share button below the video. A popup will open with share options and the share link shown
- Click on the embed button to get the HTML code to embed a Youtube Video as shown in the image below. Copy the video embed code.
The Embed Parameters
There are many YouTube parameters that you can use, offering a user control over many aspects of a video. Some of the more popular ones are:
- autoplay=0 (default); YouTube embed Autoplay is disabled
- autoplay=1; autoplay enabled, the video starts to play automatically on page load
- controls=0 ; player controls not displayed
- controls=1 (default); player controls displayed
- fs=0 ; full screen button disabled
- fs=1 (default) ; full screen button enabled
- This particular parameter has undergone a change effective Sept 25th, 2018. In the past, you could use this parameter to disable the display of suggested or related videos at the end of a video. From Sept 25th, you will not be able to disable suggested or related videos, since it is considered an intrinsic part of the YouTube platform. Please note, the parameter is still valid and you can use it to set the suggested or related videos to show only videos from the same channel.
- rel=1 (default); shows suggested or related videos from all YouTube channels
- rel=0; suggested or related videos from the same channel
- Enhanced Privacy Mode
- Enhanced privacy mode allows you to embed a youtube video without using cookies to track user behavior. Any recommended videos will be purely based on the context of the current video playing.
- To use this feature, replace ” https://www.youtube.com” with “https://www.youtube-nocookie.com” in the embed code.
- Set Start and End Time of an Embedded YouTube Video
- This parameter is covered in more detail in our article on How To Set Start And End Time for YouTube Videos Easily
Related Article: The Right Way to Add Video in WordPress
You can see an embedded video from YouTube below, using the above parameters. The YouTube video is set to play with autoplay OFF, controls OFF, full-screen mode disabled, and enhanced privacy mode switched on. The code to embed a Youtube Video looks like this, with the parameters highlighted:
If you using a platform like WordPress or similar for your website, then it is quite likely that you probably have a YouTube Block in the platform’s frontend editor, that provides the HTML wrapper to insert the YouTube Video into your website. In this case, you won’t need full HTML code to embed the video. You will need the Youtube Video URL with the Video ID appended at the end, which looks like this:
The video ID is the alphanumeric text MqNd1xD46VY. The video ID is the unique identifier for a YouTube Video.
You can enter the URL as shown above along with the required parameters appended at the end as explained above. For example:
To embed a YouTube video in your website with Auto play on, use the following URL:
To embed a video in your website with controls on, and full screen off, use the following URL:
The video ID in the above examples should be replaced with the Video ID of the YouTube video that you want to embed in the web page.