Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder riptide's Avatar
    Join Date
    Jan 2007
    Posts
    143
    Thanks
    1
    Thanked 0 Times in 0 Posts

    can this be done

    I want to do something like this

    but I want to use avi or mpeg files and there not hosted on your computer.

    something like filename/atsomething.com

    Code:
    if (!document.getElementById) return;
      // Set up event handlers and embed the sounds
      divs = document.getElementsByTagName("div");
      for (i=0; i<divs.length; i++) {
        // embed the appropriate sound using document.write
        document.write('<embed id="' + 'note_' + divs[i].id + '"');
        document.write(' src="' + divs[i].id + '.au" width="0" height="0"');
        document.write(' autostart="false" enablejavascript="true">');
        // set up the event handler
        divs[i].onclick = PlaySound;
      }
    }
    function PlaySound(e) {
      if (!e) var e = window.event;
      // which key was clicked?
      thiskey = (e.target) ? e.target: e.srcElement;
      var sound = document.getElementById("note_" + thiskey.id);
      try {
        // RealPlayer
        sound.DoPlay();
      } catch (e) {
        try {
          // Windows Media / Quicktime
          sound.Play();
        } catch (e) {
          alert("No sound support.");
        }
      }
    }
    // Run the setup routine when this script executes
    Setup();

  • #2
    New Coder
    Join Date
    Apr 2007
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think it should be possible, but you would need to embed a video.


    function playMovie(filename){
    document.write("<embed src=\""+filename+"\" width=\"200\" height=\"240\">")
    }

  • #3
    Regular Coder riptide's Avatar
    Join Date
    Jan 2007
    Posts
    143
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by antimatter15 View Post
    I think it should be possible, but you would need to embed a video.


    function playMovie(filename){
    document.write("<embed src=\""+filename+"\" width=\"200\" height=\"240\">")
    }
    that's wjat I want to do but why do you have all those \ in it?
    they did another way. What does the function filename does use an array of file names or something if I have a list of movies to play?


  •  

    Posting Permissions

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