Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onSlideChanged & onStoryChanged Functions #20

Closed
jtkeyva opened this issue Aug 14, 2022 · 3 comments
Closed

onSlideChanged & onStoryChanged Functions #20

jtkeyva opened this issue Aug 14, 2022 · 3 comments

Comments

@jtkeyva
Copy link
Contributor

jtkeyva commented Aug 14, 2022

Is your feature request related to a problem? Please describe.
Would be great to be able to call a custom function when a slide starts & when a slide ends. For instance once a video is finished it can trigger an onSlideEnd / videoViewed function to add a view count to the database. Also, would be useful to have a function fire onSlideStart

Describe the solution you'd like
Ability to define a custom function once a slide begins and ends.

Describe alternatives you've considered
Hack the code or use a pageview base approach which has onPageChanged

Additional context
Also makes sense to have onStoryChanged so that when a new story starts you can run a different function.

@jtkeyva jtkeyva changed the title onSlideChanged Functions onSlideChanged & onStoryChanged Functions Aug 14, 2022
@ertgrulll
Copy link
Owner

Hi JT, you can add event listener using controller to achieve desired behaviour. Also you can manipulate flow by setting interceptor. Please take a look at example project.

@jtkeyva
Copy link
Contributor Author

jtkeyva commented Aug 16, 2022

Thank you! I will have a look at the code and the docs. Perhaps we can add to the readme something like:

Run custom events/functions on slide change and story change

@ertgrulll
Copy link
Owner

Documentation contains useful information about the controller but it looks like I need to update the documentation as well.

docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants