feat(html): add <media-gesture> element#1305
Conversation
Declarative gesture element that maps attributes to gesture factory calls, mirroring `<media-hotkey>`. Supports `type` (tap/doubletap), `action`, `value`, `pointer`, `region`, and `disabled` attributes. Adds gesture action resolvers in core (`resolveGestureAction`) with 10 actions calling store methods directly via selectors. Shared by both the HTML element and future React hooks. Closes #1273 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📦 Bundle Size Report🎨 @videojs/html — no changesPresets (7)
Media (8)
Players (3)
Skins (17)
UI Components (23)
Sizes are marginal over the root entry point. ⚛️ @videojs/react — no changesPresets (7)
Media (7)
Skins (14)
UI Components (19)
Sizes are marginal over the root entry point. 🧩 @videojs/core — no changesEntries (8)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (10)
📦 @videojs/spf — no changesEntries (3)
ℹ️ How to interpretAll sizes are standalone totals (minified + brotli).
Run |
Add togglePaused, toggleFullscreen, and togglePiP methods to their respective store features so gesture actions can call store methods directly via store.state[action]() instead of reimplementing toggle logic in an actions record. Gesture resolveGestureAction now falls through to store.state[name]() for direct store methods. Only seekStep, volumeStep, speedUp, and speedDown use override resolvers for their custom logic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename the store method, action name, and all references across core, html, and react packages for consistency with requestPictureInPicture and exitPictureInPicture naming. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Accept GestureActionName | (string & {}) for autocomplete while
still allowing arbitrary strings from HTML attributes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 78bd7e7. Configure here.
| const idx = playbackRates.indexOf(playbackRate); | ||
| const next = idx <= 0 ? playbackRates.length - 1 : idx - 1; | ||
| rate.setPlaybackRate(playbackRates[next]!); | ||
| }, |
There was a problem hiding this comment.
Gesture action overrides duplicate hotkey action implementations
Medium Severity
The four GESTURE_ACTION_OVERRIDES (seekStep, volumeStep, speedUp, speedDown) are character-for-character identical copies of the same implementations in HOTKEY_ACTIONS in hotkey/actions.ts. Both only use store and value from their context (not key or event), so they could easily be extracted into shared utility functions that both gesture and hotkey resolvers reference.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 78bd7e7. Configure here.


Closes #1273
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Note
Medium Risk
Introduces new gesture-action plumbing and new media state methods (
togglePaused/toggleFullscreen/togglePictureInPicture) that become part of the public store/state surface, which could affect integrators and input handling across platforms.Overview
Adds a new
media-gesturecustom element (exported from@videojs/html) that registers tap/double-tap gesture handlers on the player container and dispatches them to player/store actions via a new coreresolveGestureActionhelper.Extends core media state with
togglePaused,toggleFullscreen, andtogglePictureInPicture, implements these toggles in the DOM store features (handling fullscreen/PiP mutual exclusion), and updates hotkey/PiP action naming fromtogglePiPtotogglePictureInPictureacross HTML/React skins and button components/tests.Reviewed by Cursor Bugbot for commit 78bd7e7. Bugbot is set up for automated code reviews on this repo. Configure here.