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

fix: hide mouse tooltip on touch devices when not scrubbing #8945

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

phloxic
Copy link
Contributor

@phloxic phloxic commented Dec 22, 2024

Problem: the vjs-user-inactive class triggering the hiding of the tooltip is added much later on touch devices, therefore the mouse tooltip stays visible on its last seek target position whenever the user taps the screen to access the controls.

This change ensures that the mouse tooltip is only visible when the user is actually scrubbing.

Problem: the vjs-user-inactive class triggering the hiding of the
tooltip is added much later on touch devices, therefore the mouse
tooltip stays visible on its last seek target position whenever the user
taps the screen to access the controls.

This change ensures that the mouse tooltip is only visible when the user
is actually scrubbing.
Copy link

codecov bot commented Dec 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.72%. Comparing base (19ca3f2) to head (79a0fc9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8945   +/-   ##
=======================================
  Coverage   83.72%   83.72%           
=======================================
  Files         120      120           
  Lines        8110     8110           
  Branches     1949     1949           
=======================================
  Hits         6790     6790           
  Misses       1320     1320           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

phloxic referenced this pull request Dec 22, 2024
## Description
On desktop, a user can hover over the progress bar while content plays,
which makes it possible to seek to a relatively precise location without
disrupting playback. On mobile there is no hovering, so in order to seek
during inline playback the user can only tap a location on the progress
bar (very hard to do precisely on a small screen) or scrub to try to
hone in on a specific location (can be very clunky because seeks are
constantly being executed). This PR adds a feature to treat scrubbing on
mobile more like hovering on desktop-- while scrubbing, seeks are
disabled and playback continues, only when the user finishes scrubbing
is a single seek executed to the desired location.

One key use-case for this feature is thumbnail seeking integrations on
mobile, where the user can scrub through different thumbnail images
until they find their desired seek location.

## Specific Changes proposed
This behavior is similar to the existing `enableSmoothSeeking` behavior
in that the `PlayProgressBar` slider visibly updates with the scrubbing
movements, but differs in a few ways:
- Playback continues while scrubbing, no seeks are executed until
`touchend`.
- The seek bar's `TimeTooltip` component displays the target seek time
while scrubbing, rather than the `CurrentTimeDisplay` (which continues
to show the current time of the playing content).
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.

1 participant