Solved

How to embed a video in my web page

Posted on 2003-11-07
10
2,020 Views
Last Modified: 2010-04-09
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
Comment
Question by:longmatch
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 10

Expert Comment

by:KenAdney
ID: 9702873
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
 

Expert Comment

by:Richoo
ID: 9702879
<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
 
LVL 1

Author Comment

by:longmatch
ID: 9702979
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Expert Comment

by:KenAdney
ID: 9703004
<EMBED SRC=filename.mpg AUTOSTART=false>
0
 
LVL 1

Author Comment

by:longmatch
ID: 9703043
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
 
LVL 4

Expert Comment

by:intrwrks
ID: 9703068
Use the same format as Richoo said above, just change the src and autostart options.

<embed src="filename.mpg" autostart="false">
0
 

Expert Comment

by:Richoo
ID: 9703196
maybe try adding <embed src="filename.mpg" controller="true" autostart="false">
0
 

Expert Comment

by:Richoo
ID: 9703199
or CONTROLS=playbutton
0
 
LVL 4

Accepted Solution

by:
intrwrks earned 20 total points
ID: 9703253
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
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9703621
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add box and text color changing for everything 1 34
Multiflying 2 Input Text On a Table 7 31
Html form and modal / img src -problem 3 29
Filktering Alphabetically 8 29
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question