Add dynamic UI reconstruction to the tutorials.

Change-Id: I915e2f52a597fabd4b81711dcf97a38cf2e3d788
This commit is contained in:
Sandra Lokshina
2019-04-29 14:35:25 -07:00
parent 269b53b7a0
commit aac3657a83
2 changed files with 12 additions and 90 deletions
+11 -3
View File
@@ -3,15 +3,22 @@
#### Configuring the layout
When creating the UI via code, you can pass in configuration options that change
Once the UI is created, you can pass in configuration options that change
the look and functioning of the UI bar. For example, if you wanted to not have
a seek bar, you could add the following line to the init() function from the UI
basic usage tutorial, right before creating the UI overlay:
basic usage tutorial, after creating the UI overlay:
```js
uiConfig['addSeekBar'] = false;
const video = document.getElementById('video');
const ui = video['ui'];
const config = {
addSeekBar: false;
};
ui.configure(config);
```
Controls will fire a {@link shaka.Controls.UIUpdatedEvent} event once the config
takes effect.
See the docs for {@link shaka.extern.UIConfiguration} for more information.
#### Customizing the number and order of controls
@@ -60,6 +67,7 @@ The following buttons can be added to the overflow menu:
that support it. Button is invisible on other browsers.
<!-- TODO: If we add more buttons that can be put in the order this way, list them here. -->
UI layout can be reconfigured at any point after it's been created.
Please note that custom layouts might need CSS adjustments to look good.
#### Changing seek bar progress colors