YouTube Embedded Player Parameters

by

YouTube Embedded Player Parameters

http://code.google.com/apis/youtube/player_parameters.html

YouTube Embedded Player Parameters

Contents

Overview

This document describes all the parameters that are available in the YouTube embedded player. Appending these parameters to the SWF URL allow you to set things like color and borders, as well as whether to enable the JavaScript API for the player.

Parameters

All of the following parameters are optional.

rel
Values: 0 or 1. Default is 1. Sets whether the player should load related videos once playback of the initial video starts. Related videos are displayed in the « genie menu » when the menu button is pressed.
autoplay
Values: 0 or 1. Default is 0. Sets whether or not the initial video will autoplay when the player loads.
loop
Values: 0 or 1. Default is 0. In the case of a single video player, a setting of 1 will cause the player to play the initial video again and again. In the case of a playlist player (or custom player), the player will play the entire playlist and then start again at the first video.
enablejsapi
Values: 0 or 1. Default is 0. Setting this to 1 will enable the Javascript API. For more information on the Javascript API and how to use it, see the JavaScript API documentation.
playerapiid
Value can be any alphanumeric string. This setting is used in conjunction with the JavaScript API. See the JavaScript API documentation for details.
disablekb
Values: 0 or 1. Default is 0. Setting to 1 will disable the player keyboard controls. Keyboard controls are as follows:
Spacebar: Play / Pause
Arrow Left: Restart current video
Arrow Right: Jump ahead 10% in the current video
Arrow Up: Volume up
Arrow Down: Volume Down
egm
Values: 0 or 1. Default is 0. Setting to 1 enables the « Enhanced Genie Menu ». This behavior causes the genie menu (if present) to appear when the user’s mouse enters the video display area, as opposed to only appearing when the menu button is pressed.
border
Values: 0 or 1. Default is 0. Setting to 1 enables a border around the entire video player. The border’s primary color can be set via the color1 parameter, and a secondary color can be set by the color2 parameter.
color1, color2
Values: Any RGB value in hexadecimal format. color1 is the primary border color, and color2 is the video control bar background color and secondary border color.

Example Usage

To use any of the parameters above, append them to the end of the YouTube video SWF URL.

The SWF URL usually looks like this:

http://www.youtube.com/v/VIDEO_ID

It can be programmatically accessed through the YouTube Data API by looking for the yt:format=5 <media:content> URL. This format will not be available if embedding has been disabled by the uploader.

<media:content url="http://www.youtube.com/v/VIDEO_ID" type="application/x-shockwave-flash" medium="video"
          isDefault="true" expression="full" duration="100" yt:format="5"/>

To change the color scheme to a nice blue theme, modify the two color parameters.

http://www.youtube.com/v/VIDEO_ID&color1=0x2b405b&color2=0x6b8ab6

Now, place the modified URL into your embed code:

<object width="425" height="355">
  <param name="movie" value="http://www.youtube.com/v/u1zgFlCw8Aw&rel=1&color1=0x2b405b&
    color2=0x6b8ab6&border=1"></param>
  <param name="wmode" value="transparent"></param>
  <embed src="http://www.youtube.com/v/u1zgFlCw8Aw&rel=1&color1=0x2b405b&color2=0x6b8ab6&border=1"
    type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed>
</object>

The rel, color1, color2, and border parameters have been modified to produce the blue, bordered player below. Pressing the « menu » button will also load related videos because the rel parameter is set to 1.

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s


%d blogueurs aiment cette page :