docs(site): complete menu radio group references with demos and options hooks (#1807)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Darius Cepulis
2026-07-14 15:34:52 -07:00
committed by GitHub
co-authored by Claude Fable 5
parent 82b9e43bb5
commit a9a09a7e52
54 changed files with 1953 additions and 77 deletions
@@ -24,6 +24,12 @@ export interface AudioTrackOptionsResult {
setValue: (value: string) => void;
}
/**
* Create audio track menu options from the player audio track state. Returns
* `null` when the audio track feature is not configured.
*
* @param props - Optional `label`, `formatTrack`, and `disabled` overrides.
*/
export function useAudioTrackOptions(props?: AudioTrackOptionsProps): AudioTrackOptionsResult | null {
'use no memo';
@@ -25,6 +25,13 @@ export interface CaptionsOptionsResult {
setValue: (value: string) => void;
}
/**
* Create captions menu options (including an `Off` option) from the player
* text track state. Returns `null` when the text tracks feature is not
* configured.
*
* @param props - Optional `label`, `formatTrack`, and `disabled` overrides.
*/
export function useCaptionsOptions(props?: CaptionsOptionsProps): CaptionsOptionsResult | null {
'use no memo';
@@ -28,6 +28,12 @@ export interface PlaybackRateOptionsResult {
setValue: (value: string) => void;
}
/**
* Create playback rate menu options from the player playback rate state.
* Returns `null` when the playback rate feature is not configured.
*
* @param props - Optional `label`, `formatRate`, and `disabled` overrides.
*/
export function usePlaybackRateOptions(props?: PlaybackRateOptionsProps): PlaybackRateOptionsResult | null {
const media = usePlayer(selectPlaybackRate);
const [core] = useState(() => new PlaybackRateRadioGroupCoreClass());
@@ -36,6 +36,13 @@ function resolveAutoLabel(t: Translator, label: string): string {
return resolveTranslation(t, label);
}
/**
* Create quality menu options (including an `Auto` option) from the player
* video rendition state. Returns `null` when the quality feature is not
* configured.
*
* @param props - Optional `label`, `formatRendition`, and `disabled` overrides.
*/
export function useQualityOptions(props?: QualityOptionsProps): QualityOptionsResult | null {
'use no memo';