SHARE
Facebook X Pinterest WhatsApp

A Guide to YouTube Embedded Video Player Parameters

Written By
thumbnail
Rob Gravelle
Rob Gravelle
Jan 29, 2015

A Guide to YouTube Embedded Video Player Parameters

If you’ve ever looked at the YouTube video embed markup, it’s really nothing more than an iFrame with the src set to the video server and unique video ID. What you may not realize is that the URL also accepts a number of query parameters that govern the behavior of the video playback. Popular options include starting at a specific point and forcing the HD quality version to play. In this follow-up to the There’s More than One Way to Play Embedded YouTube Videos! article, we’ll go over some of these and test their effect on an embedded video.

Including Video Parameters

Underneath the embed code, you’ll see a link to “Show More” options:

That brings up a video preview, along with some extra parameters, including:

  • Video size
  • Show suggested videos when the video finishes
  • Show player controls
  • Show video title and player actions
  • Enable privacy-enhanced mode

Setting the view size changes the iFrame’s height and width attributes. The other four are added to the URL in the form of query parameters. For instance, deselecting the Show player controls checkbox adds “?controls=0” to the URL. Additional parameters are appended using the URL encoded “&” ampersand (&), i.e. “?controls=0&showinfo=0”, but the unencoded ampersand character works just as well.

But that’s just the tip of the iceberg. You can manually append many more options yourself. For the remainder of the article, we’ll try out a few of them, using my alter ego’s slideshow music video as an example.

Setting the Start and End Points

You may only be interested in showing part of a video on your site. For that, you can set the start and end parameters. Both take a positive integer that cause player to look for the closest keyframe to the times you specify, in seconds. That may result in the actual start and end times landing just before (for start) or after (for end) the requested times, but usually by no more than about two seconds. Keep in mind that the end time is from the real start of the video and not from point that you tell it to start. Here is the URL to play only the part of the video that shows me playing the latest addition to my axe arsenal – a double neck!

//www.youtube.com/embed/5EnL2WXsxNQ?start=44&end=52

Here’s the resulting playback:

How to Get the Start and End Values

Don’t worry, you don’t have to sit there with a stop watch to figure out the start and end points! Just play the main YouTube video and pause it where you’d like it to start. Then right-click on the video and select “Get video URL at current time” from the popup menu. That will give you an URL like the following:

https://www.youtube.com/watch?v=5EnL2WXsxNQ#t=44

Note that the URL produced is that of the main video and NOT the embed code. Therefore you have to copy the “t” value into your embed URL – “44” in the above example.

Continue playing the video until your end point and repeat the above procedure for the end point.

Looping the Video

The music doesn’t have to end when the video does. You can loop it using the loop parameter. It only accepts a value of 0 (don’t loop) or 1 (loop away). The default is 0, which is the same behavior as when the loop parameter is not included.

Note that the loop parameter works best in the HTML5 player. In the AS3 player, the loop parameter only works when used in conjunction with the playlist parameter. As a workaround, you can loop a single video by setting the playlist parameter value to the same video ID as already defined in the URL:

Here’s the URL for that:

http//www.youtube.com/embed/5EnL2WXsxNQ&loop=1&playlist=5EnL2WXsxNQ

…which produces the following*:

*Note that I used the start parameter to begin video playback towards the end of the video.

Setting YouTube Video Parameters the Easy Way!

Once you’ve got more than a couple of parameters to deal with, it can quickly become a tiring process. An easier way to append parameters is to utilize an online form such as the one found on the TechAirlines site.

Just pick and choose the ones you want, and it generates the URL accordingly. In that form, the “Website Parameters” section generates URL to play the video on the YouTube site, whereas the “Embed Parameters” section is for creating a URL for embedded video content.

Conclusion

For the full parameter list as well as their descriptions, visit the YouTube Embedded Players and Player Parameters page. The TechAirlines page also contains explanations of each parameter.

Recommended for you...

Working with Camtasia Studio 9 and HTML5
Nathan Segal
Apr 13, 2018
Best Practices for Inlining Frames in HTML Pages
Bootstrap 3 Modal: Create a Timed Alert and Video Player
Rob Gravelle
Aug 3, 2017
How to Create HTML5 Video in 5 Steps
Nathan Segal
Jun 22, 2016
HTML Goodies Logo

The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.