Solved

How to embed a video in my web page

Posted on 2003-11-07
10
1,990 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
Comment Utility
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
Comment Utility
<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
Comment Utility
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
Comment Utility
<EMBED SRC=filename.mpg AUTOSTART=false>
0
 
LVL 1

Author Comment

by:longmatch
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 4

Expert Comment

by:intrwrks
Comment Utility
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
Comment Utility
maybe try adding <embed src="filename.mpg" controller="true" autostart="false">
0
 

Expert Comment

by:Richoo
Comment Utility
or CONTROLS=playbutton
0
 
LVL 4

Accepted Solution

by:
intrwrks earned 20 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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 …
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

744 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