How to embed a YouTube video into an article Print
User Rating: / 2
PoorBest 
Written by Julian Haines   
Wednesday, 08 September 2010 08:28

This is a method for embedding a YouTube player directly into a website article, so that a user has only to press play in order to watch the video (example). Although the player is embedded, the video is streamed directly from YouTube's servers. One reason to use this approach rather than a simple link to the YouTube website is that you can put the video directly into context with the text of the article around it, rather that it being a standalone item on a different website.

Note that although this method will also work with a forum posting, it's probably easier to use the built-in video button on the forum posting form as this requires no knowledge of syntax.

Minimal method

  1. Go to the YouTube website and find the video that you want to embed in your article.
  2. Look at the URL for the video in the address bar of your browser. It should look something like this: http://www.youtube.com/watch?v=ctGXK7bPpJc
  3. Copy the video id from the end of the URL, everything after the ?v= part of the URL. In the above example this is "ctGXK7bPpJc" (without the quotes).
  4. Go to your article and type the following tag into the text of the article at the place where you want the video to appear, pasting the video id that you copied in step 3 in place of xxx:

{qtube vid:=xxx}

or, using the example video's id,

{qtube vid:=ctGXK7bPpJc}

Once you've submitted your article you can view it. The tag that you included in the text of your article will be replaced with a YouTube player showing the video that you selected.

Need more control?

You can control the size, definition and other features of the video player by adding extra parameters to the tag. Some other possibilities include:

{qtube vid:=xxx w:=320 h:=267 hd:=1}

  • vid it's the only mandatory parameter and we've already explained it above.
  • w, h are used to set video frame width and height in pixels.
  • hd (0/1): show video in HD (if available).

Where parameters are not specified, the defaults for the website are used instead.

Example

By way of an example, here's a YouTube player embedded using {qtube vid:=ctGXK7bPpJc}.

Further information

See the vendor's documentation for the QTube plug-in which provides these features.

Last Updated on Friday, 10 September 2010 08:46