VideoQualitySelect and VideoQualitySelectItem offer a dropdown selection
mechanism for users to choose their preferred video quality. These React
components are built upon the @livepeer/core/media framework and
@radix-ui/primitive for a standardized, accessible user experience.
Introduction
VideoQualitySelect
VideoQualitySelect acts as a dropdown menu, enabling users to switch between
different video quality options. It reflects the current selection and updates
the playback quality based on user interaction.
Props
The component accepts all props suitable for a select root element.VideoQualitySelectItem
VideoQualitySelectItem represents an individual selectable option within the
VideoQualitySelect dropdown. Each item corresponds to a specific video quality
level.
Props
The component accepts all props appropriate for a select item element, with an additionalvalue prop:
value
A VideoQuality enum value representing the video quality that the item
corresponds to. This must be provided to ensure correct selection behavior.
This can be of the type:
"auto" | "1080p" | "720p" | "480p" | "360p" | "240p" | "144p"
Usage
Here’s a generalized example of how theVideoQualitySelect and
VideoQualitySelectItem components might be used within the Player:
VideoQualitySelect provides a dropdown menu for users to
choose from various quality levels like Auto and HD, and
VideoQualitySelectItem represents each selectable option.
Data Attributes
Both components assign data attributes to their underlying elements to reflect the current state and selection.VideoQualitySelect
data-livepeer-quality-select
Serves to identify the component’s role within the Player.
data-video-quality
Indicates the current video quality selection, matching the value of the
selected VideoQualitySelectItem.
This can be of the type:
"auto" | "1080p" | "720p" | "480p" | "360p" | "240p" | "144p"
VideoQualitySelectItem
data-livepeer-quality-select-item
Identifies the component’s role as an individual selectable option within the
VideoQualitySelect.