Video player: Page-wide shortcuts
Shortcuts work while focus is inside the player. globalShortcuts also listens on the page, but never while you type in a field, use a button or have a menu or dialog open. Use it for one player per page.
Press K anywhere on the page to play or pause.
This adds the example as components/examples/video-player/global-shortcuts.tsx, together with the Video player component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/video-player-global-shortcuts.jsonTo add only the component, follow the Video player installation.
Props in this example
The Video player props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
globalShortcutsAlso listen for shortcuts on the whole page. | boolean | false |
Every prop is in the Video player API reference.
See them all, with keyboard support and accessibility notes, on the Video player page.
- ButtonButtons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- Dropdown menuA menu of actions and options behind a button, with groups, submenus, checkbox and radio items, and shortcuts.
- KbdKey caps for shortcuts that show the right symbols on every platform, read them out properly and press down with the real keys.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- SpinnerA loading indicator with Apple-style ticks or a breathing ring that can wait before showing and stay long enough not to flicker.
- TooltipA short hint on hover or keyboard focus that opens after a brief rest, switches instantly between neighbours and shows shortcuts.