Forums

[resolved] [Plugin: NextGEN Gallery] Prevent autoplay of slideshow (9 posts)

  1. jhheider
    Member
    Posted 2 years ago #

    I'm trying to stop nextgen-gallery's slideshow from autostarting. It should be possible. I've edited the module to have it add "enablejs : true" to the flashvars, as that seems to be the only way to do this according to http://developer.longtailvideo.com/trac/wiki/ImageRotatorApi . However, I can't seem to pull a JS element id that will allow me to sendEvent('playpause');. I'm clearly missing *something*, but I'm not sure what. I've tried walking through the elements beneath the div in which the slideshow runs, but nothing. Anyone know how this should work?

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. jhheider
    Member
    Posted 2 years ago #

    Eeeesh. Nevermind. I finally found http://wordpress.org/support/topic/253012?replies=4 . I added:

    //Build javascript
                    $this->js  = "\nvar " . $this->id  . " = {\n";
                    $this->js .= $this->add_js_parameters('params', $this->params) . ",\n";
    + //JHH
    + $this->flashvars['autostart'] = 'false';
    + //END
                    $this->js .= $this->add_js_parameters('flashvars', $this->flashvars) . ",\n";
                    $this->js .= $this->add_js_parameters('attr', $this->attributes) . ",\n";
                    $this->js .= "\tstart : function() {" . "\n\t\t";
                    $this->js .= $this->embedSWF;
                    $this->js .= "\t}\n}\n";
                    $this->js .= $this->id  . '.start();';

    and it works.

  3. WP_NEWBIE
    Member
    Posted 1 year ago #

    Are the codes below correct? I inserted them after // adding the flash parameter and it did not work. Thanks.

    //Build Javascript
    $this->js = ";\nvar"; . $this->id . " = {";
    $this->js .= $this->add_js_parameters(`params', $this->params) . ",\n";
    + //JHH
    + $this->flashvars[autostart'] =false' ;
    +//END
    $this->js .= $this->add_js_parameters(`flashvars', $this->flashvars) . ",\n";
    $this->js .= $this->add_js_parameters(`attr';, $this->attributes) . ",\n";
    $this->js .= "\tstart : function() {"; . "\n\t\t";
    $this->js .= $this->embedSWF;
    $this->js .= "\t}\n}\n;
    $this->js .= $this->id . `.start();';

  4. Paulio51
    Member
    Posted 1 year ago #

    You are missing 2 single quotes in your code.

    This line: + $this->flashvars[autostart'] =false' ;

    should look like this: + $this->flashvars['autostart'] = 'false' ;

    Hope that does it.
    Paul

  5. WP_NEWBIE
    Member
    Posted 1 year ago #

    Thanks Paul. I just corrected it. Still not working. Not sure what else I should do.

  6. Paulio51
    Member
    Posted 1 year ago #

    So sorry, I just quickly scanned this post and that is what I saw wrong with your code. I should have looked a little deeper into what was trying to be accomplished.

    Have you tried just adding the line $swfobject->add_flashvars( autostart, 'false'); to function nggShowSlideshow() in nggfunctions.php?

    When I add that line below // adding the flash parameter it stops my slideshow from autostarting.

    Make sure to remove your previous code before testing.

    Paul

  7. WP_NEWBIE
    Member
    Posted 1 year ago #

    It worked:) Why your original codes were so complicated?

    Can I ask one more question? If I want it to start and stop when click, what codes should I add?

    Many thanks.

  8. Paulio51
    Member
    Posted 1 year ago #

    I don't know why the OP was trying to do it that way. Maybe it came from visiting the JW Player site first.

    As far as I can see the only way to stop and start is to click on the image count text and there are no 'flashvars' to add to control that option. I don't know if you have noticed but the slideshow does start again after you click on it and it advances to the next photo. Not pretty but gets the job done.

    Paul

  9. WP_NEWBIE
    Member
    Posted 1 year ago #

    Thanks very much Paul for your assistance. I really appreciate that.

    Good luck.

Topic Closed

This topic has been closed to new replies.

About this Topic