Customize YouTube video using embed markup
Here is your standard iframe YouTube.com video code embed snippet:
Javascript | | copy code | | ? |
1 | <iframe width="560" height="315" src="http://www.youtube.com/embed/qnRYpnh6IsY?rel=0" frameborder="0" allowfullscreen></iframe> |
Notice the width and height variables. You can change these to re-size the YouTube video when it plays.
Here is what this snippet looks like embedded into your webpage:
Here is a list of YouTube embed markup variables you can add to the src="http://www.youtube.com/embed/qnRYpnh6IsY?rel=0" string, within the snippet, to control features on the YouTube video player.
Variables to Customize YouTube Video Player
-
&showinfo=0
Adding the 'showinfo' variable and setting it to 0 will turn off the title and ratings.
-
&showsearch=0
Adding 'showsearch' variable and setting it to 0 will turn off search.
-
&rel=1
The 'rel' variable is already part of the standard src string by default, setting it to 1 will turn on related videos.
-
&iv_load_policy=3
Adding the 'iv_load_policy' variable and setting it to 3 will turn off annotations.
-
&cc_load_policy=1
Adding the 'cc_load_policy' variable and setting it to 1 will turn off annotations.
-
&autoplay=1
Adding the 'autoplay' variable and adding setting it to 1 will make the video start playing automatically when someone visits the page.
-
&loop=1
Adding the 'loop' variable and setting it to '1' will make your video loop over and over once the play button is pressed.
-
&fs=0
Adding the 'fs' variable and setting it to 0 will disable the 'full screen' mode for the youtube video.
-
&hd=1
Adding the 'hd' variable and setting it to 1 will force the video to play in high definition 720p when it plays.
-
&ap=%2526fmt%3D18
Adding the 'ap' variable and setting it to '&ap=%2526fmt%3D18' will force the video to play in high quality when it plays.
-
autohide=1
Adding the 'autohide' variable and setting it to 1 will force the video to hide the video controls when the mouse isn't moving and hovering over the video.
-
modestbranding=1
Adding the 'modestbranding' variable and setting it to 1 will hide the YoutTube logo from the video.
-
disablekb=1
Adding the 'disablekb' variable and setting it to 1 will hide video controls.
Customize YouTube video tips
If your videos includes text the viewer must read, make your video player dimensions large and enable high definition.
If your video is on a homepage, or you want to make it match the website theme, disable the video controls and displays. Make the video as bland and as indifferent as possible.
If your YouTube video is promoting your brand or product, make sure the ‘rel’ variable is set to equal 0 so that your competitor's videos don’t start playing after your video is done.