The version 3 YouTube player
The player used on
http://www.youtube.com/watch?v=VIDEO_ID is YouTube's
version3 player. If you want to use it directly (without the
watch?v= part) you can do, for instance:
http://www.youtube.com/v/EUSsXdhxFIM?version=3. (You may have to press CTRL if you want this to work in IE).
The advantage of the
version3-player over other versions is that a click on a playing video doesn't open a new YouTube window containing all sorts of information that you may not be interested in. The click event just pauses the video.
You can include a
version3-video with something like:
<object type="application/x-shockwave-flash" style="position:absolute; left:20%; top:20%; height:60%; width:60%; border:1px solid black;" data="http://www.youtube.com/v/EUSsXdhxFIM?
version=3&
amp;rel=0&
amp;autoplay=1&
amp;showinfo=0&
amp;start=5" >
<param name="movie" value="http://www.youtube.com/v/EUSsXdhxFIM?
version=3&
amp;rel=0&
amp;autoplay=1&
amp;showinfo=0&
amp;start=5" >
<param name="allowFullScreen" value="true" >
<param name="wmode" value="transparent" >
<param name="flashvars" value="autoplay=true" >
</object>
As soon as I understood this, I decided to write a script allowing us to load videos (that use the version3 player) with the help of a javascript function.
Here it is.
Usage (just an example):
<a href="javascript: void(0)" onmouseover="info='Holst: Jupiter'" onclick="show_yt('EUSsXdhxFIM', '&rel=0&autoplay=1&showinfo=0&start=0', '50px','50px','50px','50px')">A Video</a>
Explanations:
- You must put something for the mouseover (info part, in red), otherwise you may get wrong information about the video. If you don't want info on top of the video, just put onmouseover="info=null". You can use plain HTML for the info.
- The string in green denotes the YouTube video id.
- The part in blue: official YouTube parameters. If you don't know what the values stand for, see this. You must use &tamp;, not simply &.
- The brownish part specifies the distance of the video with respect to the left border, top border, right border and bottom border, respectively, of the window. IE6 does not understand this, but that's no problem, since YouTube no longer officially supports IE6. So my script is in line with YouTube's policy.
© Arie Molendijk.