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

Pause 'Autoplay' when scrolled off screen. #4419

Merged
merged 3 commits into from
Jun 25, 2020
Merged

Conversation

infinite-persistence
Copy link
Contributor

@infinite-persistence infinite-persistence commented Jun 22, 2020

PR Type

Changes

  • When the autoplay overlay gets partially off-screen, the timer will be stopped. We can tweak how much down it needs to be scrolled.
  • When timer is paused, the countdown resets.
  • The pausing mechanism has no effect on the floating player (since the 'top' can never go negative). This behavior is the same as another big video platform.
  • Pause when any Modal is present.

Aside

  • Also present in 0.46.2: I noticed that with the first video viewed from a fresh session, the timer takes a while to appear. (Update: seems like just need to scroll down for "Related"to load at least once).

@infinite-persistence infinite-persistence marked this pull request as draft June 22, 2020 07:48
@infinite-persistence infinite-persistence marked this pull request as ready for review June 22, 2020 09:50
Copy link

@neb-b neb-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great! Two small comments.

ui/component/autoplayCountdown/view.jsx Outdated Show resolved Hide resolved
ui/component/autoplayCountdown/view.jsx Outdated Show resolved Hide resolved
@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Jun 22, 2020
Fixes #-4021.

## Changes:
When the autoplay overlay gets partially off-screen, the timer will be stopped. We can tweak how much down it needs to be scrolled.

When timer is paused, the countdown resets.

The pausing mechanism has no effect on the floating player (since the 'top' can never go negative). This behavior is the same as another big video platform.
@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Jun 23, 2020
1. Use a constant for the classname instead of being hardcoded.
2. Use existing 'debounce' function instead of introducing another.
3. Added changelog entry.
@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Jun 23, 2020
@neb-b neb-b merged commit b010325 into master Jun 25, 2020
@neb-b neb-b deleted the pause-autoplay-when-offscreen branch June 25, 2020 04:23
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

Successfully merging this pull request may close these issues.

Don't Allow Autoplay when commenting / taking other actions
2 participants