Learning HTML by yourself

E1 - Embedding Video in your site.

11/11/2011 19:06

Very simple with youtube.  There is a button that says to embed.  It puts the video in an iform (something you already know about).   Click on the "share button under the video.

Then click on the embed button and the code will come up for you to put on your page.  See below.


But if you have a video and you want to embed it into your html document, you can use the embed tag to display your media file.  The embed tag does not require a closing tag.  It works much like an image tag.  A scr attribute must be defined by the correct URL in order for the video file to be displayed correctly.  You can also set the sizes of all of it.  If you look at the code for the YouTube video file then you can understand how to put in your own file.


You can also embed flash files.  See the code below:


<a href="yourflashfile.swf">
my flash file</a>

There are a number of attributed for this one as well.  For example:

  • autostart - controls the media's ability to start without prompting.  Values are true or false.
  • hidden - controls whether or not the play/stop/pause embedded object is hidden or not.  Values are true or false.
  • loop - a true value means the media will continuously loop, false means no looping.
  • playcount - setting a playcount means the media will repeat itself X number o ftimes instead of continuously as with the loop attribute above.  (playcount="2" will repeat the video twice.
  • volume - set a numberic value for the loudness of your media.  It goes from 0 - 100