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 8 of 8
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post

    Autoplay of a flash movie

    Hello all,

    I have embedded an object (flash video) and it automatically starts when the page is loaded. Does anyone know of a method to not start these automatically but have a play intro link/button that allows this movie to start?

    Something like the youtube play button in the movie would be nice.

    PHP Code:
    <object width="180" height="180">
        <
    param name="movie" value="http://www.domain.com/swf/movie.swf">
        <
    embed src="http://www.domain.com/swf/movie.swf" width="180" height="180" loop="false">
            </
    embed>
    </
    object
    Last edited by twomt; 01-03-2008 at 02:04 AM.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,880
    Thanks
    6
    Thanked 1,035 Times in 1,008 Posts
    • At first this is a Flash issue. You have put a play button in the Flash movie, hence, you have to set automatic (or manual) playback in your Flash file, not in the HTML.
    • There is a non-standard (i.e. invalid) autoplay attribute for the similarly non-standard (i.e. invalid) embed element which you can set to 0 (don’t play) or 1 (play automatically). However, this won’t generate a “play” button, ’cause as I said, this is a Flash thing. Also this is more meant for playback of plain audio files, not flash.
    • Likewise, there is a similar value for the <param> element (<param name="autoplay" value="true [/false]">). However, functionality is based on the settings of/in the Flash movie (i.e. you have to enable it there before setting it in the HTML will do anything).
    • If I go to YouTube and choose a video it starts playback automatically. The play button only comes after one pass.

  • Users who have thanked VIPStephan for this post:

    twomt (01-03-2008)

  • #3
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    OK,

    am a bit confused now...

    I've tried to keep my website as much as possible to standards and what I read above makes me feel that I am now using non-standard elements to display a flash movie.

    Is there a "better" or let's say more standardized way to do so?

    If I understood you correctly, I need to go to my gfx team to tell them to change the flash movie in such a way that it does not automatically start.
    Is that correct?

    Thanks for your help.
    Nemesis War
    Online browser based space combat game.
    It's free, it's great, you'll love it.
    Come join us at http://www.nemesiswar.net/

  • #4
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    I take it that you are using the <embed> tag to display your Flash movie then? <embed> is depracated in HTML 4.01 and if you are using a correct doctype (preferably strict) this will not validate as HTML. You need to use something like the Flash Satay method which is described here

    And as for the second part, yes, you need to have the movie begin with a 'play' button so that it doesn't actually start until that button is pressed
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • Users who have thanked ahallicks for this post:

    twomt (01-03-2008)

  • #5
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    OK,

    with the help of that link you have given me, the object is now coded as follows:

    PHP Code:
    <object type="application/x-shockwave-flash" 
         
    data="http://www.nemesiswar.net/swf/intro_8.swf" width="180" height="180" id="">
        <
    param name="movie" value="http://www.nemesiswar.net/swf/intro_8.swf" />
        <
    param name="play" value="false" />
        <
    param name="loop" value="false" />
        <
    param name="quality" value="autohigh" />
    </
    object
    That seems to already work for me, I now need to find out what other param settings I can use for the flash files.

    Would this then be according to the real (non-microsoft) standard?
    Last edited by twomt; 01-03-2008 at 01:16 PM.
    Nemesis War
    Online browser based space combat game.
    It's free, it's great, you'll love it.
    Come join us at http://www.nemesiswar.net/

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,880
    Thanks
    6
    Thanked 1,035 Times in 1,008 Posts
    Yeah that should work. However, I suspect that you’ll get a notice in IE that you have to confirm whether or not you wanna display the object. This is because there was a lawsuit.

    So, some ingeious mind developed a technique to prevent that and it’s called SWFObject. That’s how most people do it nowadays and that’s also how they do it at YouTube.

  • #7
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    Quote Originally Posted by VIPStephan View Post
    Yeah that should work. However, I suspect that you’ll get a notice in IE that you have to confirm whether or not you wanna display the object. This is because there was a lawsuit.

    So, some ingeious mind developed a technique to prevent that and it’s called SWFObject. That’s how most people do it nowadays and that’s also how they do it at YouTube.

    Thank you very much indeed. My flash movies are now called using swfobject
    Nemesis War
    Online browser based space combat game.
    It's free, it's great, you'll love it.
    Come join us at http://www.nemesiswar.net/

  • #8
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    Wow, I didn't realise youtube had moved on to using SWFObject! It's been so long since I had to use any form of Flash I had forgotten all about the javascript method for implementation, which is also great from a standards point of view as you can create something to 'sit behind' the Flash that will show if the user has their javascript disabled, and also gives and HTML render of the Flash (for example, a menu as I used)
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools


  •  

    Posting Permissions

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