You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds compound tooltips with separate label and keyboard-shortcut regions across HTML custom elements, React, and skins. Hotkey metadata flows through an extended coordinator (display shortcuts, optional action value, subscriber notifications). Playback rate uses core-owned copy and spinbutton semantics so tooltip and accessibility stay aligned on both platforms. Coordinator-driven shortcut updates no longer double-fire tooltip sync.
Screenshots
Changes
HTML: media-tooltip-label and media-tooltip-shortcut; tooltip syncs label/shortcut from the trigger and can create default parts when markup is empty
Core: hotkey coordinator gains getShortcut, display formatting, subscribe/notify, and HOTKEY_SHORTCUT_CHANGE_EVENT; exports getHotkeyCoordinator and toDisplayKeyShortcut
Skins / presets: layout and tokens for shortcut affordance; default <media-hotkey> wiring in minimal skins where appropriate
AriaKeyShortcutsController: coordinator callback only schedules requestUpdate; MediaButtonElement continues to emit hotkey-shortcut-change when the display shortcut actually changes (avoids duplicate tooltip sync)
PlaybackRateButton (core): default label Playback speed for tooltip and aria-label; role="spinbutton" with aria-valuenow, aria-valuetext (e.g. 1.25×, same numeric string as valuenow), and aria-valuemin / aria-valuemax from the current playbackRates list when non-empty
React createMediaButton: merge order [getButtonProps(), elementProps, last attrs] so getAttrs() (spinbutton role and ARIA) wins over createButton’s default role="button"
Docs: playback rate reference page updated for the new accessibility model
Shortcut updates: controls subscribe to the coordinator; MediaButtonElement.#syncHotkeyShortcut dedupes by last display shortcut string before dispatching HOTKEY_SHORTCUT_CHANGE_EVENT.
Rate strings for ARIA use a shared formatter (three-decimal rounding) so aria-valuenow and the numeric part of aria-valuetext stay identical.
Testing
pnpm typecheck
pnpm -F @videojs/core test src/core/ui/playback-rate-button src/dom/hotkey
pnpm -F @videojs/html test src/ui/tooltip src/ui/hotkey src/ui/playback-rate-button
pnpm -F @videojs/react test src/ui/
Note
Medium Risk
Refactors hotkey shortcut resolution and fans out through accessibility attributes and tooltip UI across HTML/React presets; behavior is covered by tests but registration-order and value-matching semantics affect what users see in tooltips and aria-keyshortcuts.
Overview Tooltips now split into label and keyboard shortcut regions (media-tooltip-label / media-tooltip-shortcut in HTML; Tooltip.Label / Tooltip.Shortcut in React). Presets and skins wire those parts and style the shortcut (e.g. media-tooltip__kbd, popup.tooltipShortcut).
Hotkey metadata is unified in HotkeyCoordinator: the separate ARIA registry is removed in favor of getShortcut(action, value?), which returns both aria (toAriaKeyShortcut) and a compact shortcut (toDisplayKeyShortcut, e.g. Ctrl+K). Bindings can be filtered by action value (e.g. seek step seconds), disabled bindings are excluded, and the latest registration is preferred for display. subscribeShortcutChanges and HOTKEY_SHORTCUT_CHANGE_EVENT notify controls when registrations change.
Controls subscribe to that flow: AriaKeyShortcutsController / useHotkeyShortcut (replacing useAriaKeyShortcuts) refresh aria-keyshortcuts and display shortcuts; MediaButtonElement dedupes and dispatches shortcut-change events; tooltips sync label + shortcut from triggers (including getShortcut() on media buttons). Seek and playback rate buttons declare matching hotkey actions/values in HTML and React.
Tooltip popup styling adds flex layout when open so shortcut chips layout correctly without breaking closed [popover] hiding. Slider skin tokens pick up minor drag/focus-ring tweaks unrelated to tooltips.
Reviewed by Cursor Bugbot for commit 0682ce3. Bugbot is set up for automated code reviews on this repo. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1299
Summary
Adds compound tooltips with separate label and keyboard-shortcut regions across HTML custom elements, React, and skins. Hotkey metadata flows through an extended coordinator (display shortcuts, optional action
value, subscriber notifications). Playback rate uses core-owned copy and spinbutton semantics so tooltip and accessibility stay aligned on both platforms. Coordinator-driven shortcut updates no longer double-fire tooltip sync.Screenshots
Changes
media-tooltip-labelandmedia-tooltip-shortcut; tooltip syncs label/shortcut from the trigger and can create default parts when markup is emptygetShortcut, display formatting, subscribe/notify, andHOTKEY_SHORTCUT_CHANGE_EVENT; exportsgetHotkeyCoordinatorandtoDisplayKeyShortcutTooltip.Label/Tooltip.Shortcut,useHotkeyShortcut(replacesuseAriaKeyShortcuts), tooltip context updates<media-hotkey>wiring in minimal skins where appropriaterequestUpdate;MediaButtonElementcontinues to emithotkey-shortcut-changewhen the display shortcut actually changes (avoids duplicate tooltip sync)Playback speedfor tooltip andaria-label;role="spinbutton"witharia-valuenow,aria-valuetext(e.g.1.25×, same numeric string asvaluenow), andaria-valuemin/aria-valuemaxfrom the currentplaybackRateslist when non-emptycreateMediaButton: merge order[getButtonProps(), elementProps, last attrs]sogetAttrs()(spinbutton role and ARIA) wins overcreateButton’s defaultrole="button"Implementation details
MediaButtonElement.#syncHotkeyShortcutdedupes by last display shortcut string before dispatchingHOTKEY_SHORTCUT_CHANGE_EVENT.aria-valuenowand the numeric part ofaria-valuetextstay identical.Testing
pnpm typecheckpnpm -F @videojs/core test src/core/ui/playback-rate-button src/dom/hotkeypnpm -F @videojs/html test src/ui/tooltip src/ui/hotkey src/ui/playback-rate-buttonpnpm -F @videojs/react test src/ui/Note
Medium Risk
Refactors hotkey shortcut resolution and fans out through accessibility attributes and tooltip UI across HTML/React presets; behavior is covered by tests but registration-order and value-matching semantics affect what users see in tooltips and
aria-keyshortcuts.Overview
Tooltips now split into label and keyboard shortcut regions (
media-tooltip-label/media-tooltip-shortcutin HTML;Tooltip.Label/Tooltip.Shortcutin React). Presets and skins wire those parts and style the shortcut (e.g.media-tooltip__kbd,popup.tooltipShortcut).Hotkey metadata is unified in
HotkeyCoordinator: the separate ARIA registry is removed in favor ofgetShortcut(action, value?), which returns botharia(toAriaKeyShortcut) and a compactshortcut(toDisplayKeyShortcut, e.g.Ctrl+K). Bindings can be filtered by actionvalue(e.g. seek step seconds), disabled bindings are excluded, and the latest registration is preferred for display.subscribeShortcutChangesandHOTKEY_SHORTCUT_CHANGE_EVENTnotify controls when registrations change.Controls subscribe to that flow:
AriaKeyShortcutsController/useHotkeyShortcut(replacinguseAriaKeyShortcuts) refresharia-keyshortcutsand display shortcuts;MediaButtonElementdedupes and dispatches shortcut-change events; tooltips sync label + shortcut from triggers (includinggetShortcut()on media buttons). Seek and playback rate buttons declare matching hotkey actions/values in HTML and React.Tooltip popup styling adds flex layout when open so shortcut chips layout correctly without breaking closed
[popover]hiding. Slider skin tokens pick up minor drag/focus-ring tweaks unrelated to tooltips.Reviewed by Cursor Bugbot for commit 0682ce3. Bugbot is set up for automated code reviews on this repo. Configure here.