How to embed a video in my web page

I would like to embed a video file in my html page.  The scenario is I have a student test page, I want a movie to be shown on this page. When students click PLAY button or link, the movie start. If the movie can be shown within the same page as my test page (embedded in the same window), that will be perfect.

Thanks everybody's effort

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The tags will depend a little on what the format of the video is (streaming or not and whether you want to embed the player).  You can find some sample embed coding at  There's also a simple (and funny) tutorial at
<EMBED SRC=filename.avi AUTOSTART=true>

should embed the movie directly into the page you want and have it start playing

what file format is the video?
longmatchAuthor Commented:
My video is mpg format, I do not want it to play automatically. I want the video to play after user's click.


Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

<EMBED SRC=filename.mpg AUTOSTART=false>
longmatchAuthor Commented:
When I change AUTOSTART=false, I have no way to make it play. There is no button for me to click. Can we control the movie using some clent side coding?

Use the same format as Richoo said above, just change the src and autostart options.

<embed src="filename.mpg" autostart="false">
maybe try adding <embed src="filename.mpg" controller="true" autostart="false">
or CONTROLS=playbutton
Use javascript to play the movie when a button is pressed.



<script language="javascript">

function playMovie() {
      document.getElementById('movie').innerHTML="<embed src='filename.mpg' autostart='1'></embed>";



<div id="movie">Movie Plays Here</div>

      <input type="button" value="Play Movie" onclick="javascript:playMovie();">


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
not tested but may work

<embed id="mov" src='filename.mpg' autostart='false'></embed>

     <input type="button" value="Play Movie" onclick="document.getElementById('mov').setAttribute('autostart',true);">
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.