Video player settings
ProA video player's settings: a small panel over the picture at the player's corner whose rows open pages in its place (speed, captions, quality), a bottom sheet on phones. Not an M3 component (@windmorph/react-pro).
import { VideoPlayerSettings, VideoPlayerSettingsTrigger, VideoPlayerSettingsItem, VideoPlayerSettingsSwitch, VideoPlayerSettingsChoice, VideoPlayerSettingsSpeed, VideoPlayerSettingsPage } from '@windmorph/react-pro';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Keyboard
| Key | Action | Where |
|---|---|---|
| Enter or Space | On the Settings button: opens or closes the panel.The button | The button |
| Arrow Down or Arrow Up | Moves to the next or previous row that shows, going round.A list of rows | A list of rows |
| Home or End | Moves to the first or last row.A list of rows | A list of rows |
| A letter | Moves to the next row whose name starts with it.A list of rows | A list of rows |
| Enter or Space | Acts, switches, opens its page, or chooses.A row | A row |
| Arrow Right | Opens the page of a row that has one (Arrow Left in right to left).A row with a page | A row with a page |
| Arrow Left | Goes back to the first page (Arrow Right in right to left).A page | A page |
| Escape | Goes back one page; on the first page, closes the panel. | |
| Tab or Shift + Tab | Moves through the page's controls: the header, then on the speed page Slower, the slider, Faster and the presets. Past the last, the panel closes. | |
| Arrow Left or Arrow Right or Page Up or Page Down or Home or End | Slower or faster by 0.05, by 0.25 with Page Up and Page Down, to the slowest or fastest with Home and End.The speed slider | The speed slider |
| Arrow Left or Arrow Right | Moves between the presets, as a group of one choice.The presets | The presets |
- Keys pressed inside the panel are its own: none reach the player (K, M, F, C, the digits, Space, the arrows), in full screen too, and an arrow nothing uses doesn't scroll the page.
- A row hidden by CSS (Autoplay and Rotate where the bar shows them) is skipped by the keys.
Screen reader
- Role
- The panel is a non-modal
dialog. The first page is amenu: an action or a row with a page is amenuitem(witharia-haspopup), a switch row amenuitemcheckbox. A choice page is amenuofmenuitemradios; the speed page agroupwith asliderand aradiogroupof presets. - Accessible name
- The panel is named as its button ("Settings",
labels.settings). A row's name is written out: its label, a badge's words after a space, then a comma and its value ("1080p HD", "Quality, Auto (720p)"). Itsdescriptiondescribes it (aria-describedby) rather than joining the name. The header is one button, "Back, Quality" (labels.back), holding the title it shows; the page stays named by that title. - States announced
- A switch row reports
aria-checked; the drawn switch is hidden. The chosen option of a choice reportsaria-checked; its tick is decoration. The speed slider reads its value in words ("Normal", "1.5×"), and Slower and Faster say the new speed in a polite region mounted first. A preset's caption describes it.
- A page change isn't announced: focus moving into the page says its name and the focused row.
- A text badge is read as written ("1080p HD"); a badge that isn't text (an icon) is read as its
badgeLabel. A mark before a preset takes a name from you if it means something.
Focus
- Opening moves focus to the first row that shows (with
childrenas a function, the first row it places); a new page to its first row, its chosen row, or the slider on the speed page, all without scrolling. - Going back focuses the row the page came from. Closing by Escape, the button or a choice focuses the button; a press outside returns focus to the button only if it was inside. Focus never lands on the page.
- Rows and buttons show the two-tone on-media focus ring on keyboard focus only, never for a focus a script moved.
Touch target
- Rows are 48px tall. Slower and Faster are 32px buttons with 48px targets.
- In the bottom sheet (under 600px of window) the speed page takes M3's touch sizes: the core slider, 40px tonal buttons and 40px presets.
Motion
- The panel fades in and out in 50ms; a choice closes it at once.
- Pages slide a full width in 150ms while the height follows on the same timing, mirrored in right to left.
- Under reduced motion pages and height change at once; the fade stays.
What you need to do
- Alone, put your button first in
VideoPlayerSettingsTrigger, with a name ("Settings"), and name a positionedcontainerfor the panel. - Give a badge that isn't text a
badgeLabel(on a row or an option), so its meaning is read with the name. - Give each row a short
label, and avaluethat says what is chosen; give a row whose label isn't plain text atextValuefor the letter search. - Keep the default fill and quieter text unless your own keep 4.5:1 over a white frame.
- Translate
labels(settings,back, and the speed page'sspeed,normal,slower,faster,presets,speedValue,speedExact), or set them once for the app with aLabelsProvider. - In forced-colours mode the panel is
Canvaswith aCanvasTextedge, and the chosen preset and tick areHighlight.