SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Onclick play embedded video

    I wrote this to trigger the video when an image is clicked, but it doesnt work. 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>

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,198
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    As far as i can see javascript doesn't support the .play() method but i did find the source to a script that looks to be working perfectly.

    http://snipplr.com/view/2384/javascr...-sound-ie--ff/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •