-
Notifications
You must be signed in to change notification settings - Fork 7.5k
fix: hide mouse tooltip on touch devices when not scrubbing #8945
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
Conversation
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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
## 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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for another great contribution @phloxic !
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.