Constructor
new PlaybackRateSelection(parentnon-null, controlsnon-null)
Parameters:
- Extends:
- Source:
Extends
Classes
- Factory
Members
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
backSpan :HTMLElement
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
currentSelection :HTMLElement
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
Type:
- Overrides:
- Implements:
- Source:
mutationObserver_ :MutationObserver
Type:
- Overrides:
- Source:
nameSpan :HTMLElement
Type:
- Overrides:
- Implements:
- Source:
parent :HTMLElement
Type:
- Overrides:
- Implements:
- Source:
playbackRateMark_ :HTMLElement
Type:
- Source:
Type:
- Overrides:
- Implements:
- Source:
resizeObserver_ :ResizeObserver
Type:
- Overrides:
- Source:
resizeRafId_ :number
Type:
- Overrides:
- Source:
speedValue_ :HTMLElement
Type:
- Source:
Type:
- Overrides:
- Implements:
- Source:
videoContainer_ :HTMLElement
Type:
- Overrides:
- Source:
Methods
Parameters:
- Overrides:
- Source:
Shared positioning algorithm used by both OverflowMenu and SettingsMenu.
Computes:
- maxHeight so the menu does not overflow the video container vertically.
- left/right offset so the menu stays within the controls bar
horizontally, aligned with the button that opened it.
Parameters:
| Name |
Type |
Description |
menuElement |
HTMLElement
|
The floating menu div to position. |
buttonElement |
HTMLElement
|
The button that triggered the menu. |
controlsContainer |
HTMLElement
|
The bottom controls bar used as the horizontal reference. |
- Overrides:
- Source:
applyRate_(rate)
Parameters:
| Name |
Type |
Description |
rate |
number
|
|
- Source:
Formats a preset rate for display inside a pill button.
Rules
- Comma as decimal separator.
- Always at least one decimal place (e.g. 1 to "1,0", 3 to "3,0").
Parameters:
| Name |
Type |
Description |
rate |
number
|
|
- Source:
Returns:
-
Type
-
string
getSliderRange_() → {{min: number, max: number}}
Returns the effective slider range.
Normally this is [playbackRateSliderMin, playbackRateSliderMax] from the
config. If the current rate was set programmatically outside that range,
the bounds are extended just enough to keep the thumb visible.
- Source:
Returns:
-
Type
-
{min: number, max: number}
stepRate_(delta)
Steps the playback rate by `delta`, snapped to
`config.playbackRateSliderStep` and clamped to
the configured [playbackRateSliderMin, playbackRateSliderMax] range.
Snapping the current rate to the step grid before adding delta ensures that
a programmatic value like 0.97 is brought back onto the grid (0.95 or
1.00) on the next user interaction rather than accumulating floating-point
drift.
Parameters:
| Name |
Type |
Description |
delta |
number
|
|
- Source:
updatePlaybackRateSelection_()
Syncs slider range/value, live value label, step-button disabled state,
and preset-pill highlights to the current player rate.
- Source: