Solved

How to embed a video in my web page

Posted on 2003-11-07
10
2,002 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Radio button Onclick submit form with validation 5 44
while loop in html mail format 5 59
Bootstrap 3 application structure 7 45
Objects on Same Line 2 18
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now