https://github.com/dimsemenov/PhotoSwipe/issues/753
rogerbinns commented on 8 Feb 2015
This is a feature request to the ui to add slideshow functionality (essentially automatically next every N seconds) with a button alongside the others to start it. Ideally any user interaction should cancel the auto next. It would also be nice if I could make photoswipe start with the auto next already on.
👍 3
dimsemenov added the Feature Request label on 12 Feb 2015
Owner
dimsemenov commented on 12 Feb 2015
For now I don’t have plans to add this feature, at least until fade transition feature is ready.
It’s not that hard to implement it by yourself, use PhotoSwipe public API http://photoswipe.com/documentation/api.html
JimCook57 commented on 13 Feb 2015
Following…. I would like this feature too.
JimCook57 commented on 17 Jul 2015
Any plans to add this into the core functionality?
JimCook57 commented on 20 Oct 2015
Has anyone implemented this?
Plixo commented on 10 Feb 2016
it’s done in one line, after you create and init your psp, aka:
psp = new PhotoSwipe(…); psp.init();
Just do this:
setInterval(function(){psp.next();},4000);
Author
rogerbinns commented on 11 Feb 2016
That just forces a transition every 4 seconds. It should also be stopped if the user interacts (eg they zoom in a pic to take a closer look, or go back to a previous pic). Plus some sort of toggle for auto next being on/off. Even the timing needs some attention. For example if it takes 3 seconds to display the image (eg slow network) then the timer should really start from when the image is reasonably visible, and not from when the loading started.
Shivang44 commented on 7 Jun 2016
I agree with @rogerbinns on this, @Plixo‘s solution isn’t very optimal. Are there any plans to add it now or is it still the same status?
jtbr commented on 11 Jun 2016 • edited
Here is what I do.
-
Make a button in the photoswipe toolbar: In the photoswipe markup on your page, insert this after the other buttons:
In the CSS for your page, insert the following:
These media queries match those used by the other toolbar icons.
Put these PNGs in the directory with your CSS:
pause-wh.png — (
)
play-wh.png — (
) (they appear invisible on a white background)
Create two SVG files in the same dir with the following contents: pause-wh.svg:
and play-wh.svg:
-
Now add some javascript to your page. They assume you called your photoswipe variable lightBox.
It uses jQuery, since my page does, but this wouldn’t be hard to remove.
The user toggles the slideshow function on and off by using the play/pause button (which changes depending upon the mode). It can also be aborted by hitting the escape key. Slides change every 2.5 seconds (starting after the prior image loaded).
👍 11❤️ 3
pwFoo commented on 13 Jun 2019
Would be nice to see it merged to PhotoSwipe
daltimus11 commented on 6 Sep 2019 • edited
Lot’s of edits on this comment, but the important take away is that the code provided does function, it just has an issue that occurs if the slideshow is started and paused too quickly.
jtbr commented on 9 Sep 2019
You shouldn’t need to ever click the start/stop slideshow button
repeatedly, as it only begins the process. You don’t need to click it again
to change slides…
But if you think users will repeatedly click it anyway, you could keep
track of the number of outstanding timers pending (increment the variable
when calling setTimeout() and decrement it when entering gotoNextSlide()),
and don’t call setTimeout if this is greater than 0. What’s happening is
that multiple timeouts are getting created if you click start/stop rapidly
enough (within 1.25s by default).
If you do this, please post the code. Good luck
👍 1
daltimus11 commented on 9 Sep 2019 • edited
Thank you for explaining, it helped me understand what was happening a lot better.
Edit: I’ve decided not to implement a slideshow on my gallery.
andi34 added a commit to andreknieriem/photobooth that referenced this issue on 1 Dec 2019
andi34 mentioned this issue on 11 Dec 2019
Feature: add slideshow option to gallery andreknieriem/photobooth#203
Closed
1 of 2 tasks complete
andi34 added a commit to andreknieriem/photobooth that referenced this issue on 3 Jan
andi34 commented on 4 Jan • edited
Thanks for your shared code @jtbr . You could point me in the right direction to refresh the image database after X seconds and start the slideshow directly with latest image without the need to click on a thumbnail and without another click to start the slideshow again?
andi34 added a commit to andreknieriem/photobooth that referenced this issue on 11 Jan
andi34 added a commit to andreknieriem/photobooth that referenced this issue on 11 Jan
andi34 added a commit to andreknieriem/photobooth that referenced this issue on 11 Jan
andi34 added a commit to andreknieriem/photobooth that referenced this issue on 11 Jan
andi34 added a commit to andi34/photobooth that referenced this issue on 15 Jan