Extending the controls and settings options API to support adding new controls and changing the order
See original GitHub issueThe current array options for buttons and settings has some limitation:
- You can’t exclude a button or setting. You have to specify all buttons/settings you want to include instead (more verbose and complicated).
- It’s not possible to control the order of the buttons. While it would be possible for Plyr to respect the array order (as a comment in the source code suggests), this would be a breaking change.
- It’s not possible to add a custom button using the Plyr API directly (#787). The only way to do this now is by dom manipulation
Alternative syntax (boolean to disable, number to change the order):
new Plyr(element, {
controls: {
playLarge: false, // disable the big play button
mute: 4, // move mute to after volume, for some reason
chapters: 7 // add custom button "chapters" at position 7
}, settings: {
speed: false // disable speed settings
}
});
The custom button “chapters” (#1011) could work by triggering a custom event. For example “plyr-custom-chapters”. This could also work with future plugin support, by letting plugin extend the Plyr defaults.
I’m not sure how to deal with svg icons, labels, toggle-states buttons or “sliders” though. It’s likely we need a more complex API for custom buttons.
This is not a high prio task. I just wanted to put it out there for feedback since the second and third issues have been brought up a few times.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Extending the controls and settings options API to support ...
Extending the controls and settings options API to support adding new controls and changing the order.
Read more >Customizer Objects | Theme Developer Handbook
The Customize API is object-oriented. There are four main types of Customizer objects: Panels, Sections, Settings, and Controls. Settings associate UI ...
Read more >Important changes (deprecations) coming in Power Apps and ...
We will be introducing new Fluent controls which have better usability ... Internet Explorer 11 support for Dynamics 365 and Microsoft Power ...
Read more >Control when app changes are published with managed ...
Changes that are not held back by managed publishing · Increasing an existing staged roll-out to 100% · Updating your app's ”Release notes”...
Read more >Controls | Maps JavaScript API - Google Developers
By default, all the controls disappear if the map is too small (200x200px). You can override this behavior by explicitly setting the control...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 , don’t really have an input on how it should look in terms of an API, I trust whatever you guys come up with. My use case is that I would like to add a button for ‘theatre’ mode, so I’d be looking to just add an icon that I can target with some JS to make the necessary DOM adjustments.
Can anyone help me add a custom button/link next to the volume button please?