5 URL Parameters to Improve Your YouTube Embedding
Matcha Design - Tuesday, February 8, 2011
There are many benefits to using YouTube to embed videos. It speeds up user access to the video while reducing bandwidth consumption on your own hosting, and it's a widely familiar interface with many features built in. There are several ways to customize the behavior of the YouTube video player as well. For the purposes of this tutorial, I'm going to assume that you're using the embed URL format (http://www.youtube.com/v/Sla2VebjkQk), rather than the link format (http://www.youtube.com/watch?v=Sla2VebjkQk). To add these URL parameters, take the video URL and add ?param=value for the first and ¶m=value for subsequent parameters. So for example, to set autoplay on and allow fullscreen mode, use http://www.youtube.com/v/Sla2VebjkQk?autoplay=1&fs=1 remember that if you're embedding the URL in a link, iframe, or anywhere on a webpage, escape the ampersands by changing them from "&" to "&".
-
autoplay
Can be set to 0 or 1. Default is 0. Setting it to 1 causes the video to play automatically when it's displayed, rather than waiting for the user to press play. This is useful if it's embedded in a lightbox and not loaded until the lightbox is displayed.
-
rel
Can be set to 0 or 1. Defaults to 1. Setting it to 0 disables the "related videos" feature from appearing at the end. This is useful because it keeps people focused on your site, rather than using it to browse YouTube.
-
playlist
This parameter can be set to a comma-seperated list of videos to play after the originally linked one. If you have a long video cut into smaller parts, you can use this to play them all together.
-
loop
Can be set to 0 or 1. Default is 0. Setting it to 1 causes the video (or playlist) to be repeated indefinitely.
-
start
Set to a postive number. Playback will begin the specified number of seconds into the video, in other words, it will skip the first X seconds, where X is the value of the start parameter. Note that the seeking is approximate and may be off by up to two seconds.
About Matcha Design
Matcha Design is a full-service creative agency specializing in web design, print, identity, branding, interface design, video production, still photography and motion design. Using our passion for excellence, multi-cultural background, and award winning practices, we consistently provide high-quality, custom, innovative solutions to meet the diverse marketing needs of our clients. For more information, visit www.MatchaDesign.com.