mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-23 17:27:16 +03:00
feat(ui): Add configurable rates (#3579)
Adds configurable options for playback, fast forward and rewind rates. Closes: #3443
This commit is contained in:
@@ -163,6 +163,22 @@ const config = {
|
||||
ui.configure(config);
|
||||
```
|
||||
|
||||
#### Configuring playback, fast forward and rewind rates
|
||||
The rate in which the player can play, fast forward and rewind content can be configured using the `playbackRates`, `fastForwardRates` and `rewindRates` options.
|
||||
|
||||
* `playbackRates`: List of rates available in the `playback_rate` menu.
|
||||
* `fastForwardRates`: List of rates available to cycle through every time the `fast_forward` button is clicked.
|
||||
* `rewindRates`: List of rates available to cycle through every time the `rewind` button is clicked.
|
||||
|
||||
```js
|
||||
const config = {
|
||||
'controlPanelElements': ['playback_rate', 'fast_forward', 'rewind'],
|
||||
'playbackRates': [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
|
||||
'fastForwardRates': [2, 4, 8, 1],
|
||||
'rewindRates': [-1, -2, -4, -8],
|
||||
}
|
||||
ui.configure(config);
|
||||
```
|
||||
|
||||
#### Creating custom elements and adding them to the UI
|
||||
It's possible to add custom application-specific buttons to the UI.
|
||||
|
||||
Reference in New Issue
Block a user