feat(ui): Add configurable rates (#3579)

Adds configurable options for playback, fast forward and rewind rates.
Closes: #3443
This commit is contained in:
Nico
2021-08-23 12:22:27 -04:00
committed by GitHub
parent 0e02312597
commit f65b093d40
6 changed files with 50 additions and 20 deletions
+16
View File
@@ -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.