• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2064
  • Last Modified:

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

Longmatch
0
longmatch
Asked:
longmatch
  • 3
  • 2
  • 2
  • +2
1 Solution
 
KenAdneyCommented:
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 http://www.streamalot.com/embed.shtml.  There's also a simple (and funny) tutorial at http://www.htmlgoodies.com/tutors/videoembed.html.
0
 
RichooCommented:
<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?
0
 
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.

thanks

LM
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
KenAdneyCommented:
<EMBED SRC=filename.mpg AUTOSTART=false>
0
 
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?

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

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

+++++++++++++CODE

<html>
<head>
<title>Untitled</title>
</head>

<script language="javascript">

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

</script>

<body>

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

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

</body>
</html>
0
 
jaysolomonCommented:
not tested but may work

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

<form>
     <input type="button" value="Play Movie" onclick="document.getElementById('mov').setAttribute('autostart',true);">
</form>
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now