autoplay
parameter or cause a video to play repeatedly using the loop
parameter. You can also use the enablejsapi
parameter to enable the player to be controlled via the IFrame Player API.<iframe>
tag<iframe>
tag in your application in which the src
URL specifies the content that the player will load as well as any other player parameters you want to set. The <iframe>
tag's height
and width
parameters specify the dimensions of the player.<iframe>
element yourself (rather than using the IFrame Player API to create it), you can append player parameters directly to the end of the URL. The URL has the following format:<iframe>
tag below would load a 640x360px player that would play the YouTube video M7lc1UVf-VE
. Since the URL sets the autoplay
parameter to 1
, the video would play automatically once the player has loaded.playerVars
property identifies player parameters.id
value of ytplayer
. The onYouTubePlayerAPIReady()
function specified here is called automatically when the IFrame Player API code has loaded. This code does not define any player parameters and also does not define other event handlers.src
URL.VIDEO_ID
text in the URLs above with that value to create the player URL.listType
player parameter to playlist
. In addition, set the list
player parameter to the YouTube playlist ID that you want to load.PL
as shown in the following example:PLAYLIST_ID
text in the URL above with that value.listType
player parameter to user_uploads
. In addition, set the list
player parameter to the YouTube username whose uploaded videos you want to load.Parameters | |
---|---|
| This parameter specifies whether the initial video will automatically start to play when the player loads. Supported values are 0 or 1 . The default value is 0 .If you enable Autoplay, playback will occur without any user interaction with the player; playback data collection and sharing will therefore occur upon page load. |
| This parameter specifies the default language that the player will use to display captions. Set the parameter's value to an ISO 639-1 two-letter language code. If you use this parameter and also set the cc_load_policy parameter to 1 , then the player will show captions in the specified language when the player loads. If you do not also set the cc_load_policy parameter, then captions will not display by default, but will display in the specified language if the user opts to turn captions on. |
| Setting the parameter's value to 1 causes closed captions to be shown by default, even if the user has turned captions off. The default behavior is based on user preference. |
| This parameter specifies the color that will be used in the player's video progress bar to highlight the amount of the video that the viewer has already seen. Valid parameter values are red and white , and, by default, the player uses the color red in the video progress bar. See the YouTube API blog for more information about color options.Note: Setting the color parameter to white will disable the modestbranding option. |
| This parameter indicates whether the video player controls are displayed:
|
| Setting the parameter's value to 1 causes the player to not respond to keyboard controls. The default value is 0 , which means that keyboard controls are enabled. Currently supported keyboard controls are:
|
| Setting the parameter's value to 1 enables the player to be controlled via IFrame Player API calls. The default value is 0 , which means that the player cannot be controlled using that API.For more information on the IFrame API and how to use it, see the IFrame API documentation. |
| This parameter specifies the time, measured in seconds from the start of the video, when the player should stop playing the video. The parameter value is a positive integer. Note that the time is measured from the beginning of the video and not from either the value of the start player parameter or the startSeconds parameter, which is used in YouTube Player API functions for loading or queueing a video. |
| Setting this parameter to 0 prevents the fullscreen button from displaying in the player. The default value is 1 , which causes the fullscreen button to display. |
| Sets the player's interface language. The parameter value is an ISO 639-1 two-letter language code or a fully specified locale. For example, fr and fr-ca are both valid values. Other language input codes, such as IETF language tags (BCP 47) might also be handled properly.The interface language is used for tooltips in the player and also affects the default caption track. Note that YouTube might select a different caption track language for a particular user based on the user's individual language preferences and the availability of caption tracks. |
| Setting the parameter's value to 1 causes video annotations to be shown by default, whereas setting to 3 causes video annotations to not be shown by default. The default value is 1 . |
| The list parameter, in conjunction with the listType parameter, identifies the content that will load in the player.
list and listType parameters, the IFrame embed URL does not need to specify a video ID. |
| The listType parameter, in conjunction with the list parameter, identifies the content that will load in the player. Valid parameter values are playlist and user_uploads .If you specify values for the list and listType parameters, the IFrame embed URL does not need to specify a video ID. Note: A third parameter value, search , has been deprecated and will no longer be supported as of |
| In the case of a single video player, a setting of 1 causes the player to play the initial video again and again. In the case of a playlist player (or custom player), the player plays the entire playlist and then starts again at the first video.Supported values are 0 and 1 , and the default value is 0 .Note: This parameter has limited support in IFrame embeds. To loop a single video, set the loop parameter value to 1 and set the playlist parameter value to the same video ID already specified in the Player API URL: |
| This parameter lets you use a YouTube player that does not show a YouTube logo. Set the parameter value to 1 to prevent the YouTube logo from displaying in the control bar. Note that a small YouTube text label will still display in the upper-right corner of a paused video when the user's mouse pointer hovers over the player. |
| This parameter provides an extra security measure for the IFrame API and is only supported for IFrame embeds. If you are using the IFrame API, which means you are setting the enablejsapi parameter value to 1 , you should always specify your domain as the origin parameter value. |
| This parameter specifies a comma-separated list of video IDs to play. If you specify a value, the first video that plays will be the VIDEO_ID specified in the URL path, and the videos specified in the playlist parameter will play thereafter. |
| This parameter controls whether videos play inline or fullscreen on iOS. Valid values are:
|
| Note: This parameter is changing on or after September 25, 2018. Prior to the change, this parameter indicates whether the player should show related videos when playback of the initial video ends.
rel parameter is set to 0 , related videos will come from the same channel as the video that was just played. |
| This parameter causes the player to begin playing the video at the given number of seconds from the start of the video. The parameter value is a positive integer. Note that similar to the seekTo function, the player will look for the closest keyframe to the time you specify. This means that sometimes the play head may seek to just before the requested time, usually no more than around two seconds. |
| This parameter identifies the URL where the player is embedded. This value is used in YouTube Analytics reporting when the YouTube player is embedded in a widget, and that widget is then embedded in a web page or application. In that scenario, the origin parameter identifies the widget provider's domain, but YouTube Analytics should not identify the widget provider as the actual traffic source. Instead, YouTube Analytics uses the widget_referrer parameter value to identify the domain associated with the traffic source. |
playsinline
parameter definition has been updated slightly to explain that the parameter pertains to both mobile browsers on iOS and iOS WebViews.autoplay
parameter definition has been updated to explain that if you enable Autoplay, playback will occur without any user interaction with the player; playback data collection and sharing will therefore occur upon page load.list
and listType
parameters.listType
parameter value to search
will generate a 4xx
response code, such as 404
(Not Found
) or 410
(Gone
).search.list
method to retrieve search results and then load selected videos in the player.showinfo
parameter, which was deprecated in 2018, has been removed from this document.showinfo
parameter. In addition, the behavior for the rel
parameter is changing. Titles, channel information, and related videos are an important part of YouTube’s core user experience, and these changes help to make the YouTube viewing experience consistent across different platforms.rel
parameter is changing on or after September 25, 2018. The effect of the change is that you will not be able to disable related videos. However, you will have the option of specifying that the related videos shown in the player should be from the same channel as the video that was just played.0
, then the player does not show related videos.rel
parameter is set to 0
, the player will show related videos that are from the same channel as the video that was just played.showinfo
parameter, which indicates whether the player should display information like the video title and uploader before the video starts playing, is also being deprecated. Following the change, the channel avatar and video title will always display before playback begins, when playback is paused, and when playback ends. The avatar being displayed is new behavior that will be consistent across all embedded players.showinfo
parameter will be ignored. The behavior following the changes is consistent with the current default behavior for embedded players with the exception of the channel avatar changes mentioned above.cc_lang_pref
parameter can be used to specify the default language that the player will use to display captions. This parameter can be used in conjunction with the cc_load_policy
parameter to automatically show captions in the specified language during playback.controls
parameter's definition has been updated to remove references to the deprecated Flash (AS3) player. The value 2
has been deprecated as it was originally designed to provide a performance improvement for embeds that loaded a Flash player.widget_referrer
parameter helps to enable more accurate YouTube Analytics reporting when the YouTube player is embedded in a widget, and that widget is then embedded in a web page or application.disablekb
parameter definition has been corrected to note that the default value is 0
, which means that keyboard controls are enabled. A value of 1
indicates that keyboard controls should be disabled.0
jumps to the beginning of the video, 1
jumps to the time 10% into the video, 2
jumps to the point 20% into the video, and so forth.autohide
parameter has been deprecated for the HTML5 player. In HTML5 players, the video progress bar and player controls display or hide automatically. That behavior corresponds to an autohide
setting of 1
.theme
parameter has been deprecated for the HTML5 player. HTML5 players now always use the dark theme.<object>
embeds, the YouTube Flash Player API and the YouTube JavaScript Player API have all been deprecated as of January 27, 2015. A deprecation warning appears in several sections of this document to help point readers to the IFrame Player API as an alternative.autohide
parameter has been updated to clarify the meaning of the parameter's values. The default behavior (autohide=2
) is that if the player has a 16:9 or 4:3 aspect ratio, the player's video progress bar and player controls display or hide automatically. Otherwise, those controls are visible throughout the video.hl
parameter has been updated to note that the parameter value could be an ISO 639-1 two-letter language code or a fully specified locale. For example, fr
and fr-ca
are both valid parameter values.enablejsapi
parameter has been reworded to clarify that the parameter enables a player to be controlled via API calls. The API could be either the IFrame Player API or the JavaScript Player API.cc_load_policy
, disablekb
, end
, fs
, list
, and listType
parameters. The parameter descriptions have been updated accordingly.hl
parameter can be used to set the player's interface language. The interface language is used for tooltips in the player and also affects the default caption track. The selected caption track may also depend on the availability of caption tracks and user's individual language preferences.playsinline
parameter, which only affects HTML5 players on iOS, has been modified slightly. The definition now notes that setting the parameter value to 1
causes inline playback only for UIWebViews
created with the allowsInlineMediaPlayback
property set to TRUE
.playsinline
parameter controls whether videos play inline or fullscreen in an HTML5 player on iOS. Setting the value to 1
causes inline playback.controls
parameter's definition has been updated to reflect the fact that the parameter value only affects the time that the Flash player actually loads in IFrame embeds. In addition, for IFrame embeds, the parameter value also determines when the controls display in the player. If you set the parameter's value to 2
, then the controls display and the Flash player loads after the user initiates the video playback.controls
parameter has been updated to reflect support for a parameter value of 2
and to explain that, for AS3 players, the parameter value determines the time when the Flash player actually loads. If the controls
parameter is set to 0
or 1
, the Flash player loads immediately. If the parameter value is 2
, the Flash player does not load until the video playback is initiated.color
, modestbranding
, and rel
parameters, and the definitions for these parameters have been updated accordingly.showinfo
parameter has been updated to explain how that if the player is loading a playlist, and you explicitly set the parameter value to 1
, then, upon loading, the player will also display thumbnail images for the videos in the playlist. Note that this functionality is only supported for the AS3 player since that is the only player that can load a playlist.showinfo
parameter's definition has been updated to reflect the fact that the HTML5 player supports this parameter.end
parameter specifies the time, measured in seconds from the start of the video, when the player should stop playing a video. Note that the time when playback is stopped is measured from the beginning of the video and not from the value of either the start
player parameter or the startSeconds
parameter, which is used in YouTube Player API functions for loading or queueing a video.list
and listType
parameters let you specify the content that the player should load. You can specify a playlist, a search query, or a particular user's uploaded videos.fs
and rel
parameters have been updated to more clearly explain the default parameter values for the AS3 player.border
, color1
, egm
, hd
, and showsearch
parameters, which are all only supported for the deprecated AS2 Player API, have been moved to a new section named deprecated parameters only used in the AS2 Player API.theme
and color
parameters let you customize the appearance of the embedded player's player controls. See the YouTube API blog for more information.modestbranding
parameter lets you use a YouTube player that does not show a YouTube logo. As of this release, the parameter was only supported for the AS3 embedded player and for IFrame embeds that loaded the AS3 player. As of June 5, 2012, the HTML5 player also supported this parameter.border
, color1
, color2
, egm
, hd
, and showsearch
.loop
parameter has limited support in the AS3 player and in IFrame embeds, which could load either an AS3 or HTML player. Currently, the loop
parameter only works in the AS3 player when used in conjunction with the playlist
parameter. To loop a single video, set the loop
parameter to 1
and set the playlist
parameter value to the same video ID already specified in the Player API URL:controls
and playlist
Icompta 6 0 13. parameters are supported in the AS3 and HTML5 players but are not and will not be supported in the AS2 player.autohide
parameter, which indicates whether the player's video controls will automatically hide after a video begins playing.controls
parameter, which indicates whether the player's video controls will display at all. (Player controls do display by default.)playlist
parameter, which specifies a comma-separated list of video IDs to play.fs
has been updated to note that the fullscreen option will not work if you load the YouTube player into another SWF.