HTML and CSS Reference
In-Depth Information
Figure 7-33
Parameters of the youtube player
Default Value Description
Indicates whether to play the video automatically (1) or to wait
for the user to press the play button (0)
Removes the player controls (0) or displays them (1)
Enables the user to play the video full screen (1) or not (0)
Causes the high-definition version of the video to play (1) or not (0)
Sets the video to repeat (1) or to play only once (0)
playlist= list
Plays a list of videos, where list is a comma-separated list of videos
Indicates whether to display a list of related YouTube videos (1)
or to disable that feature (0)
start= value
Starts the video playback value seconds into the video
For example, the following URL identifies a unique YouTube video, allows users to play
the video in full-screen mode, and displays a list of related videos when the clip is finished:
The complete HTML code is as follows:
<object width=”640” height=”349”>
<param name=”movie”
value=”” / >
<param name=”allowFullScreen” value=”true” />
<embed src=””
width=”640” height=”349”
allowFullScreen=”true” />
Notice that you also can include the allowFullScreen parameter either as a param
element or as an attribute of the embed element to turn on full-screen viewing of the video.
Starting in 2010, YouTube also began providing alternate embedding code to support
browsers using HTML5 that do not support Flash. The general syntax is
<iframe type=”text/html” width=” value ” height=” value
src=” url
frameborder=”0” parameters >
where once again url identifies the YouTube video and parameters controls the
appearance and actions of the YouTube player. The iframe element is used to store inline
frames, which are windows into the content of another Web page or Internet resource.
YouTube makes it very easy to generate the code required to embed its videos. You
simply can click the Share button below a video on the YouTube Web site and copy
the HTML code displayed by YouTube into the appropriate location in your HTML file.
Please note that any videos submitted to YouTube are still subject to copyright restrictions
and are removed if those restrictions are violated.
You can learn more about
the iframe element in the
Search WWH ::

Custom Search