Javascript and Embedded Video

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dmal
    New Member
    • Jan 2011
    • 3

    Javascript and Embedded Video

    I wrote a script that allows me to start a video when an image is clicked. It works fine for html5 video but not embedded video (VLC+Webm). How do i make my script recognize the embedded video?

    Testing this in FF3.6 and FF4b9.


    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>
Working...