HTML Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
HTML Basic
Introduction
How To
HTML Tags
html, head, body
Text Manipulation
IMAGES
Special Effects
Using Tables
Forms
Other Topics
 



ADVANCED HTML
Introduction
Media
Meta Tag
Frame tags
Fieldset
Tooltip
DTD
Image tags
Subscript & Superscript
Bullet styles
Canvas
Other tags
Ask Your Doubts
More about HTML
Feedback
 




Embedding Video to HTML File


Tutorials Html

Topic

How a video file can be embedded into a webpage?
How to add a media player into HTML files?



Explanation

HTML embedding video in IE:

Adding a media player to HTML page is simple using the embed tag. Mostly the embed element is used for embedding video files into the html pages. We can also use the DYNSRC attribute of the image element for adding media file. It works only in the Internet explorer.

Example Code:

<IMG DYNSRC="ourmovie.mov" LOOP="true" WIDTH="200" HEIGHT="100">

HTML embedding using the embed element:

Just use <EMBED> tag to add video

Example Code:

<EMBED SRC="mymovie.mov" WIDTH="200" HEIGHT="100" AUTOPLAY="TRUE" LOOP="true"></EMBED>

This will include a media file into your webpage.

Result:

click here to view the result of above code

Attributes of Embed Tag:

  • SRC: This attribute takes the video/movie to the source URL.

  • WIDTH and HEIGHT: It specifies the dimensions of the plug-ins.

  • AUTOPLAY: Its value can be either TRUE or false
    TRUE: Movie plays when page loads
    FALSE: Waits for the user to click the play button in window media player.

  • LOOP: Setting this to TRUE will play the media file continuously. A FALSE value will play the media only once.

  • CONTROLLER: Display controls. Can be set to TRUE or FALSE.


Adding video using Object Tag:

Video files can also be inserted into the webpage or html pages using the standard object tag. Object element works in both IE and netscape browsers. For some types, like QuickTime document, adding the classid attribute will load the controls.

Example Code:
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="240">
<param name="src" value="data/intro.wmv" >
<param name="controller" value="true" >
<param name="autoplay" value="false">
<object type="video/quicktime" data="data/intro.wmv" width="320" height="240">
<param name="controller" value="true" >
<param name="autoplay" value="false">
alt : <a href="intro.wmv">test movie</a>
</object>
</object>

Result:

alt : test movie

Note:If your browser supports this object tag, video will display or you have to click on the link to view the video.




Other Links

web hosting