Conversation
|
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
Presets (7)
Media (5)
Players (3)
Skins (16)
UI Components (23)
Sizes are marginal over the root entry point. ⚛️ @videojs/react
Presets (7)
Media (4)
Skins (14)
UI Components (20)
Sizes are marginal over the root entry point. 🧩 @videojs/core
Entries (6)
🏷️ @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 |
CI Failure Diagnosis
|
There was a problem hiding this comment.
Pull request overview
Adds a new cross-platform “gesture” abstraction (core + React + HTML) and wires it into the default/minimal video skins to toggle playback on pointer interactions, supported by a new useMediaContainer hook in React for container-level event binding.
Changes:
- Introduces
GestureCorein@videojs/coreplus initial unit tests. - Adds React
Gesturecomponent and HTMLmedia-gesturecustom element, and includes them in video skin templates/presets. - Extends React player context to track the media container (
useMediaContainer, container registration inContainer).
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/ui/gesture/index.ts | Adds a barrel export for the React Gesture component. |
| packages/react/src/ui/gesture/gesture.tsx | Implements React headless Gesture component that binds pointer events to the media container. |
| packages/react/src/testing/mocks.tsx | Updates test helpers to include container/setContainer in PlayerContextValue. |
| packages/react/src/presets/video/skin.tsx | Installs default gesture behavior into the default React video skin. |
| packages/react/src/presets/video/minimal-skin.tsx | Installs default gesture behavior into the minimal React video skin. |
| packages/react/src/player/tests/context.test.tsx | Updates context tests for extended PlayerContextValue shape. |
| packages/react/src/player/create-player.tsx | Provider now tracks container state and exposes it via context. |
| packages/react/src/player/context.tsx | Adds useMediaContainer and container registration lifecycle in Container. |
| packages/react/src/media/tests/video.test.tsx | Updates PlayerContextValue usage to include container fields. |
| packages/react/src/media/tests/audio.test.tsx | Updates PlayerContextValue usage to include container fields. |
| packages/react/src/index.ts | Exports useMediaContainer and React Gesture from the package entrypoint. |
| packages/html/src/ui/gesture/gesture-element.ts | Adds media-gesture custom element that binds to the player container and forwards events to GestureCore. |
| packages/html/src/index.ts | Exports GestureElement from the HTML package entrypoint. |
| packages/html/src/define/video/skin.ts | Registers gesture element and adds <media-gesture> to the default video skin template. |
| packages/html/src/define/video/minimal-skin.ts | Registers gesture element and adds <media-gesture> to the minimal video skin template. |
| packages/html/src/define/ui/gesture.ts | Adds safeDefine(GestureElement) module for side-effect registration. |
| packages/html/src/define/background/skin.ts | Adjusts background skin slot markup (removes redundant slot="media" attribute). |
| packages/core/src/core/ui/gesture/tests/gesture-core.test.ts | Adds initial unit tests for GestureCore behavior. |
| packages/core/src/core/ui/gesture/gesture-core.ts | Introduces GestureCore, allowed gesture types/commands, and pointer-type handling. |
| packages/core/src/core/index.ts | Re-exports GestureCore from the core package entrypoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Refactors the HTML custom element context system from simple setter callbacks (`mediaAttachContext`, `containerAttachContext`) to richer context objects that carry both the current value and its setter (`mediaContext`, `containerContext`). This enables descendant elements to read the current media/container reference without needing a separate context. On the React side, adds `container` to `PlayerContextValue` and exposes a `useContainer()` hook for accessing the container element. Extracted from #805. Co-authored-by: Wesley Luyten <luwes@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Refactors the HTML custom element context system from simple setter callbacks (`mediaAttachContext`, `containerAttachContext`) to richer context objects that carry both the current value and its setter (`mediaContext`, `containerContext`). This enables descendant elements to read the current media/container reference without needing a separate context. On the React side, adds `container` to `PlayerContextValue` and exposes a `useContainer()` hook for accessing the container element. Extracted from #805. Co-authored-by: Wesley Luyten <luwes@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Refactors the HTML custom element context system from simple setter callbacks (`mediaAttachContext`, `containerAttachContext`) to richer context objects that carry both the current value and its setter (`mediaContext`, `containerContext`). This enables descendant elements to read the current media/container reference without needing a separate context. On the React side, adds `container` to `PlayerContextValue` and exposes a `useContainer()` hook for accessing the container element. Extracted from #805. Co-authored-by: Wesley Luyten <luwes@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
container, use conext to get container
Made-with: Cursor
|
Closing this PR as we explore the new designs in #1044 and further chunk this work. |
Summary
Adds PlayGesture and Hotkeys interaction components.
PlayGesture
Click/tap the video surface to toggle play/pause — modeled as a declarative gesture component. Built on a
GestureCore→PlayGestureCoreabstraction in@videojs/corethat keeps the logic runtime-agnostic, with DOM binding (bindGesture) in@videojs/core/dom. Touch events are excluded by default (type="mouse").Hotkeys
YouTube-style keyboard shortcuts bound to the media container.
HotkeysCoremaps keys to actions (space/k = play/pause, f = fullscreen, m = mute, arrows = seek/volume, j/l = ±10s seek,</>= playback rate). Modifier keys (Ctrl/Meta/Alt) are ignored, and space only fires when the container itself is focused.Usage
HTML — drop the custom elements inside a skin template:
React — render the components inside a
<Container>:References
This PR makes progress towards two sub-issues under the gestures epic (#504)
Test plan
HotkeysCoreunit tests cover all key bindings, modifier exclusion, and edge cases (no media, missing methods)PlayGestureCoreunit tests cover play/pause toggling and ended→play restart