Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Play MPEG on click

Status
Not open for further replies.
Dec 4, 2004
10
US
Hey thanks CLFlava...really helped...

I need to add mped files to my website. I mean when a user clikcs on a link(PLAY), it should start playing the corresponding media file. I'm facing difficulties in linking the two.

-Thanks
 
it its IE only then:
<embed src="MPEG file path" name="TheMovie">


<input type="button" value="Play" onclick="document.TheMovie.play">

or

<input type="button" value="Play" onclick="document.TheMovie.play()">

Known is handfull, Unknown is worldfull
 
With this syntax, the movie starts playinf as soon as the page loads. I want the user to click on an image (not a button) to play the movie.


-Thanks
 
sorry, my mistake:
<div id="MyDiv>"
</div>

<input type="button" value="Play" onclick="PlayeMovie()">

<script>
function PlayMovie()
{
TheTag='<embed src="MPEG file path" name="TheMovie">'
document.getElementById("MyDiv").innerHTML=TheTag
}
</script>

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top