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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Make this .mov NOT pre-load?

    I have been unable to get an answer to what I hope is a very simple js request.

    How do I make the following .mov file NOT pre-load?

    What I would like is an embedded .mov file that only displays the poster frame and then gives the user the option to hit the "play" button thus deciding to downolad the .mov


    This code is everything I want, except that .mov pre-loads on the page draw.

    <embed src="movs/ddrclean.mov" width="350" height="275" hspace="25" vspace="25"autostart=false align="middle" border="0"></embed>

    Thanks for any help.

    Henry

    referring URL:
    http://www.interactivehank.com/docs/HankMovs.html

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    try using createElement or getElementById.innerHTML methods to build that object at demand (on an event)

    <script>
    function goMovie(){
    document.getElementById('movie').innerHTML ='<embed src=\"movs/ddrclean.mov\" width=\"350\" height=\"275\" hspace=\"25\" vspace=\"25\"autostart=false align=\"middle\" border=\"0\"></embed>';
    }
    </script>

    <div id="movie"></div>
    <input type="button" name="Button" value="Button" onclick="goMovie()">
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    As far as I can see, you used the code I gave it to you, but you have some errors. Now:

    You must have not more than one function with the same name, or you insert as many goMovie functions as movies you have...:-)

    I gave you a solution for a single movie. If you have more, you have to parse some parameters to the same, unique, function.
    Let's presume that you have 3 movies, in directory movs, and their names are movieone.mov, movietwo.mov and moviethree.mov

    Let's see:

    PHP Code:
    <html>
    <
    head>
    <
    script>
    function 
    goMovie(param){
    var 
    param;
    document.getElementById('movie').innerHTML ='<embed src=\"movs/'+param+'.mov\" width=\"350\" height=\"275\" hspace=\"25\" vspace=\"25\"autostart=false align=\"middle\" border=\"0\"></embed>';
    }
    </script>
    </head>
    <body>
    <div id="movie"></div>
    <br><br>
    <input type="button" value="Start Movie One" onclick="goMovie('movieone')"><br>
    <input type="button" value="Start Movie Two" onclick="goMovie('movietwo')"><br>
    <input type="button" value="Start Movie Three" onclick="goMovie('moviethree')"><br>
    </body>
    </html> 
    You see the point? Each time you press a button, you parse a parameter to the function, a parameter which has the value (string) the same with the name of the movie you want to load. Try this way, and use your file names instead of movieone.mov, movietwo.mov and moviethree.mov
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #4
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Kor
    var param;
    I think you need to get rid of this line - otherwise the function will use this (empty) local variable, instead of the value passed.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Yes, I presume that specification is useless, but I assure you that is harmless... The code will take the parameter value anyway from event handler because there is a certain value anytime.

    I agree anyway, yes, get rid of that:

    var param;
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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