Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

event 'slideEnd' should be triggered in another place #47

Closed
deepraining opened this issue Jul 28, 2015 · 8 comments
Closed

event 'slideEnd' should be triggered in another place #47

deepraining opened this issue Jul 28, 2015 · 8 comments

Comments

@deepraining
Copy link

Current Problem: the event "slideEnd" and the event "transitionEnd" are triggered almost the same time, so there's no need to do the same thing two times. The event "slideEnd" can be placed in another place, to do more.
I think, the event "slideEnd" should be trigger just after an image completing transition and kenburns(important, after the two effects completed).
Reason: the new "slideEnd" could cover the functionalities of the old one, in addition, it can do more. When an image is already completed, diaporama can jump to a random image, by listen to the event "slideEnd".
Is it practical?

@gre
Copy link
Owner

gre commented Jul 28, 2015

Hi @senntyou ,

thanks for your feedback.

The current design is that a slide includes the next transition in his timelapse. in other words, slideEnd is triggered when the previous slide has totally disappeared.
Consequently that means that as you said, transitionEnd occurs are the same time than slideEnd. Also note that there might not be any transition at all, and in that case there won't be any transitionEnd event, so the 2 events are not "the same".

I think, the event "slideEnd" should be trigger just after an image completing transition and kenburns(important, after the two effects completed).

isn't it already what is done today, after the image completed the transition?

@gre
Copy link
Owner

gre commented Jul 28, 2015

if there are 2 slides: A then B,

"jump" after "slideEnd" of A only works if the destination jump is exactly the same slide as the beginning of B.

Maybe you should change the diaporama.data rather than changing the time (jumping) ?

@gre
Copy link
Owner

gre commented Jul 28, 2015

(btw i've notice that diaporama does not look very practical if you want to render an infinite stream of images for instance, so I've created #46 to cover this)

@deepraining
Copy link
Author

thank you for replying to me. i agree that @gre

Maybe you should change the diaporama.data rather than changing the time (jumping) ?

i misunderstand the event 'slideEnd', but i still insist that there's need to provide an event after the previous slide going to be end, before the next transition start, leaving time to do some other things.
how do you think?

@gre
Copy link
Owner

gre commented Jul 28, 2015

The precise event you are looking for seems to be "slide". it will be triggered when the next slide begins.


Otherwise I don't see how I should introduce a new event:

Basically, the events directly come from the atomic unit of the timeline which is internally called "Segment", and are triggered at the beggining and at the end of each segment (internally called enter, leave functions), there can be multiple segments rendered at a same time, those are split into different rendering channels.

Here is a little schema:

img_20150728_153210

So to summarize a "slide" is not aware of transition that occurs around him (in another channel).
(At least, not in the low level implementation; and I think this is great because it allows to modularize things internally.)

@deepraining
Copy link
Author

thank you for so detailed explanation, i'v got what you say.
thank you!!!

@deepraining
Copy link
Author

Additionally, i found a bug of diaporama. When diaporama is about to circulate, "slide" and "slideEnd" will be triggered twice.

diaporama.addListener('slide', function() {console.log('slide')});
diaporama.addListener('slideEnd', function() {console.log('slideEnd')});
diaporama.addListener('transition', function() {console.log('transition')});
diaporama.addListener('transitionEnd', function() {console.log('transitionEnd')});

image

is it normally like so, or a bug?

@gre
Copy link
Owner

gre commented Jul 28, 2015

looks like a bug for me, I'll investigate thanks

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants