?
Solved

How to embed a video in my web page

Posted on 2003-11-07
10
Medium Priority
?
2,045 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 80 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…
Suggested Courses

770 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