Closed johndrinkwater closed 7 years ago
Mozilla has this experimental function, element.scrollIntoView(false);
and we can kinda emulate for the rest with window.scroll(0,findPos(document.getElementById("ts-00:00:00")));
Does the latter give us "good enough" behaviour in Mozilla browsers as well?
I feel like we should be making the audio widget position:static or shift it off into a non-scrolling column during these events so that the user doesn't have to lose their scroll position to pause, etc., and that it'd be good to do this at the same time as rolling out auto scrolling.
‘Good enough’, would prefer both options, as the latter method has caveats which is why a browser function was suggested for standardisation. No biggie, i’ll keep it generic.
As for keeping the player on screen, would prefer to use position:sticky;
over position: fixed
, but know support isn’t 100% yet.
Is there a reason for keeping the widget on screen, beyond being able to pause the audio?
Being able to pause/play/adjust volume/manually seek/observe progress/observe seeking when clicking on different timestamps without losing the current scroll position - that's a whole bunch of UI/UX stuff solved in one fell swoop).
I'm not really fussed about browser specific stuff in code that I'm not maintaining. Without knowing what those caveats are though, I can't really comment on the best course of action there.
Looks like position: sticky
is a long way off (it's still in draft with a bunch of unresolved issues and not part of any recommendation yet). If I were doing this on my own, I think I'd probably just give the shownotes element overflow-y:scroll
or something in the short term.
Dose not work on Google Chrome for me
@Lejoni is referring to the player staying on screen.
Something I just noticed which is probably fairly important is that when browsing to fragment URLs, the floating player will obscure the desired item.
That was a comment reference, silly github.
Been playing more with scrollIntoView() as (unknown to me) most browsers support it now. It is terrible. Might just retire this feature request.
Per this comment https://github.com/SteamLUG/steamlug.org/pull/80#issuecomment-68420242 look at adding auto-scroll to cast listen pages.