Commit Graph

25 Commits

Author SHA1 Message Date
Álvaro Velad Galván d07037bb66 perf(UI): Skip touch listeners when maxTouchPoints is 0 (#9981) 2026-04-15 17:45:53 +02:00
Andy(김규회) a7a37f50cb fix(UI): sync seekbar on timestamp position value between mousemove and onChange in firefox (#9840)
### Problem
The hover tooltip(mousemove) and the click tooltip(onChange) used
different formulas to calculate position.

- mousemove: `const mousePosition = Math.max(0, event.clientX -
rect.left);``
- onchange: `const position = (value - min) * scale + thumbSize / 2;`

### Fix

Extract a shared `showThumbnailAtValue_()` method so that both hover and
click use the same vlaue -> position formula


### Firefox with long term video


https://github.com/user-attachments/assets/97ea4b98-800c-4df0-8795-d5af2e311e4c

### Firefox with short term video


https://github.com/user-attachments/assets/b829cb5d-a531-4772-a320-b10a059af45a

Related Issues to #9327 
Related PR to #9827, #9818
2026-03-19 09:54:59 +01:00
Andy(김규회) 6ee5d38f10 fix(UI): sync seek position with hover timestamp using consistent position calculation (#9818)
## Problem

Previously, click/drag in the seek bar relied on the browser's default
range entry event. The hover preview used 'getValueFromPosition()'
separately. This resulted in a mismatch between the hover timestamp and
the actual search position, This problem was particularly noticeable in
long videos.

## Fix

When the mouse is down, 'e.Use preventDefault()` to block the browser's
default calculation, 'setBarValueForMouse_()' which follows the same
pattern as the existing 'setBarValueForTouch_()' Add a function to
directly call 'getValueFromPosition()' when clicking and dragging I did,
now hover, click, drag, touch all go through the same function, so
timestamp The preview and navigation positions are always synchronized.

In addition, the hard-coded 'thumbWide = 12' is 'thumbRadius = 6'
('range_elements.less') I modified it to the defined '@thumb-size') and
the browser changed the thumb [[rect.left + thumbRadius, rect.right -
thumbRadius]]' only within the range of '[rect.left + thumbRadius]',
Reflected the offset value when the click position was
reverse-calculated as a value.

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2026-03-12 11:00:53 -07:00
Álvaro Velad Galván f751ccb409 revert: Revert "fix(UI): Align seek hover and drag time (#9429)" (#9447)
This reverts commit e03b2a98e7.

Related to https://github.com/shaka-project/shaka-player/issues/9327
2025-11-28 16:23:28 +01:00
Nishant Chitkara e03b2a98e7 fix(UI): Align seek hover and drag time (#9429)
Fixes https://github.com/shaka-project/shaka-player/issues/9327
2025-11-25 12:28:13 +01:00
Álvaro Velad Galván c97e0a66ac fix(UI): The playback time displayed in the seek bar is different from currentTime when click (#8758)
Fixes https://github.com/shaka-project/shaka-player/issues/7129

---------

Co-authored-by: Theodore Abshire <TheodoreAbshire@Gmail.com>
2025-06-19 09:01:17 +02:00
Álvaro Velad Galván 5d27b56001 fix(UI): Fix seek on the seekbar at the init (#8555) 2025-05-07 18:33:00 +02:00
Álvaro Velad Galván 1a82e2754c fix(UI): Fix seekbar allows seeking even when hidden (#8540)
Fixes https://github.com/shaka-project/shaka-player/issues/8539
2025-05-05 21:31:55 +02:00
Wojciech Tyczyński 6e55a3b21b build: Forbid using dot in generic types (#7904)
Fixes #2643

Happy reviewing!
2025-01-20 09:39:51 +01:00
Álvaro Velad Galván 42d8b46fba chore: Remove old TODO about IE 11 (#7869) 2025-01-10 15:57:55 +01:00
Álvaro Velad Galván e3f85eb0ed fix(UI): Fix dragging the seek bar seeks and pans the view in VR mode (#6677)
Fixes https://github.com/shaka-project/shaka-player/issues/6625
2024-05-28 09:01:15 +02:00
Álvaro Velad Galván c483975cb8 feat(UI): Add thumbnails to the UI (#5502)
Closes https://github.com/shaka-project/shaka-player/issues/3371

Stored content thumbnails are not supported.
2023-08-22 14:25:44 +02:00
Álvaro Velad Galván 3333ca449d fix(UI): Disable right click on range elements (#5497)
Fixes https://github.com/shaka-project/shaka-player/issues/5450
2023-08-18 14:27:05 +02:00
Suraj kumar (sk) e933c368b8 fix(ui): Fix holding keyboard controls (#3267) 2021-03-24 10:09:38 -07:00
Joey Parrish 77054d2177 fix: Fix rapid keyboard-based seeking
Seeking rapidly with the keyboard controls now leverages the existing
logic for handling rapid mouse-based seeking.  A new method
(changeTo()) has been added to manage this.

This also moves the keyboard control handling from keyup to keydown
events, to handle holding down the key.  Previously, holding down the
key triggered the native key handling of the input element.

When you hold down a key, you get multiple keydown events.  When you
release it, you get a single keyup event.  So when the user holds down
the left arrow, we weren't actually doing anything.  Instead, the
keydown handler built into the input element was handling the event.

By switching to keydown events, we get those multiple events when the
key is held, and we get to handle them the way we want, instead of
letting the input element handle them in a way we can't control.

Finally, since we already had a keydown handler on the window to
manage tab navigation, this renames the two handlers to make it clear
which keydown events they handle (on which target).

Closes #3234

Change-Id: I862159adb238436dac7df6451a0f3e3c3f912360
2021-03-18 21:15:41 +00:00
Joey Parrish 5001086901 fix(ui): Fix renaming of UI base class protected members
This fixes the renaming of the protected members of SettingsMenu and
RangeElement, both of which are useful to apps building custom UI
plugins.

In order for those app-level plugins to access the protected members
of the base class, they needed to be part of an external interface.
Otherwise the compiler would rename them.

Closes #2923

Change-Id: I2edb9f1428789fac1e6c60ec6a68b20cdd249ae5
2020-10-20 15:51:54 +00:00
Joey Parrish 5e559c3797 fix(ui): Ignore seek touch events on hidden controls
When the controls are hidden, the seek bar should not respond to touch
events.  But since the seek bar is a child element of the controls
panel, it receives the touchstart event before the controls do.  So
there is no good opportunity to stop the propagation of the event.

I tried using the capturing phase of the event, but that didn't work.
So instead, we let the seek bar know if the controls are shown, and if
not, ignore touch and click events.

Further, I changed the mouseup, touchmove, and touchend event handlers
to ignore the events if the corresponding start event (mousedown or
touchstart) was ignored.  That way, you can't accidentally start a
drag operation while the controls are hidden.

Closes #2888

Change-Id: I6ee393e3d631ad3d2a8f7314af692004240fb2bd
2020-10-01 08:05:45 -07:00
Theodore Abshire 67a49d45e3 cleanup: Add missing requires.
This is a port of the internal changes: cl/329816039

Change-Id: If162e80e107ef7dc40956d6f4160d24f6d50858d
2020-09-14 22:50:49 +00:00
Joey Parrish f539147d48 fix: Correct license headers in compiled output
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.

It seems that the `!` in the header forces the compiler to keep it in
the output.  I believe older compiler releases did this purely based
on `@license`.

Issue #2638

Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
2020-06-09 16:05:09 -07:00
Joey Parrish c998ce2721 Fix live seek bar on touch screens
The UI seek bar on touch screen devices was broken in PR #2036 and
v2.5.4 - v2.5.11 for live content.  VOD content, which starts at 0,
was unaffected.

This fixes the range calculations for touch events to correctly
account for the minimum seek range.

Closes #2558

Change-Id: Ic3f6230d88703fd0ea1c9bc15057c0656b1dc42f
2020-05-12 21:14:13 +00:00
Joey Parrish 8867db6773 Fix implicit string-to-number conversions
This was caught by a compiler upgrade.

Issue #2528

Change-Id: Ica262703aa30dce2e59c139c88f3c1e74d5d9e2f
2020-04-27 17:33:06 -07:00
Joey Parrish 64896d70b0 Use shorter license header
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.

This also updates the company name from "Google, Inc" to "Google LLC".

Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
2019-11-22 18:18:36 +00:00
Sandra Lokshina a19f344568 Fix touchstart event procesing on Android.
Don't mark the event as passive, so Android can
process it properly.

NOTE: I still see occasional glitches while
seeking a live stream on Android, but the
behavior is much better. There might be another.
smaller bug affecting this, though.

Closes #2169

Change-Id: Icdad0b0029c201a50fd45da34c0361088b9d00d5
2019-10-03 11:43:47 -07:00
Matthias c9bc10d399 Fix seek bar on iOS (#2036)
Use touch events to sync the range element's value when the bar is touched.

This means you no longer have to touch the tiny ball on the seek bar on iOS.

Fixes #1918
2019-07-16 12:41:33 -07:00
Joey Parrish fcbb72561f Refactor UI range elements
This factors out common functionality and structure from the volume
bar and seek bar, both of which involved specific CSS workarounds for
IE.  The seek bar had logic to keep the value from jumping around
during casting, which now the volume bar benefits from, as well.
Finally, the seek bar code was spread out throughout controls.js, and
now it has its own class.

Closes #1913

Change-Id: I299476ccbc27f28f7b225a6e6f8b0d21abe5baf2
2019-07-10 12:26:54 -07:00