codevise / pageflow

Multimedia story telling for the web.
http://pageflow.io
MIT License
692 stars 126 forks source link

Improve onVisible/onInvisible callbacks for fade sections #1950

Closed tf closed 1 year ago

tf commented 1 year ago

The previous attempt to fix the issue in #1947 did not take into account that sections that enter with a fade transition can still exit with a different transition. So using the isActive probe to determine isVisible does not work. Instead we adapt the isVisible intersection observer to apply a root margin. We then need to ensure that onVisible and onActivate are never called out of order even if the intersection observers fire in different orders.

This is important since we mute and play videos in onVisible and unmute in onActivate. Videos might otherwise stay muted if we get the execution order wrong.

REDMINE-20230