hyunsupul / aesop-core

Open-sourced suite of components that empower interactive storytelling in WordPress.
http://aesopstoryengine.com
GNU General Public License v2.0
245 stars 56 forks source link

only autostart videos if they are visible #359

Closed cherbst closed 5 years ago

cherbst commented 5 years ago

otherwise hidden videos (e.g. inside collaped details elements) will get started already on page load (due to waypoints for these elements fire on page start because their offset is zero).

AlchemyUnited commented 5 years ago

IDK auto-play is such an anti-pattern; such a painful UX...should ASE promote such things? :)

cherbst commented 5 years ago

I would say it probably shouldn't promote it. But right now it supports it and the user can choose if he wants to use it. But then it should be done right. Right now, if the video is initially hidden, e.g. inside a closed details element, and auto play on view is selected, the video starts right after the page is loaded. The user does not know where the sound comes from and he can not stop the video as it is not shown. This commit at least fixed that. It does not change the behavior for videos that are initially visible, where auto-play on view worked correctly before. To actually make auto-play on view work inside a closed details element, one would probably have to refresh the waypoints when the element is opened. At least this is how we do it in our project, but I think this is out of the scope of this plugin, as there are possibly many different situations where the video could be initially hidden.

AlchemyUnited commented 5 years ago

@cherbst - Ahhh. I see. Thanks. Makes sense.

What about a delay load of the player on-whole? Have you ever tried that?

hyunsupul commented 5 years ago

Well, I am not the original author who added this feature. But as long as the feature is present it should work the way you expect it to I suppose.