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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Onclick trigger embedded video

Status
Not open for further replies.

612wharfavenue

Technical User
Jan 19, 2011
1
US
I wrote this to trigger a video when an image is clicked, but its not working. Any help?

Code:
<head>
<style>
#movie {}
#img {}
</style>
</head>
<body>
 
<embed type="application/x-vlc-plugin" name="VLC" target="mymovie.webm" id="movie" > </embed>
<img src=myimage.jpg" id="img" />
 
<script>
  var v = document.getElementById("movie");
  var i = document.getElementById("img");
  i.onclick = function() {
     v.play();
};
</script>
</body>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top