Open friday opened 6 years ago
Definitely agree with all of this. I had originally thought about ordering the controls based on their order in the array in the options. I guess I'm not sure which is better - defaults that you can disable or opt in/out for everything (using the array).
Creating custom buttons has been asked for before. I think passing an object in somehow would work with the title (for tooltip or hidden), icon id and callback/action/URL could possibly work.
I think the current default button selection and order is very good and intuitive. I typically only want to make small changes to is regardless of use case, and our app uses Plyr in a video grid, modals, subtitle editor and a sharable link for the result, so it's quite versatile.
We're not everyone though, so more input is appreciated.
I think an object might be a good idea. I presume false
instead of a number would mean hide the button.
On the topic of custom stuff, besides the complex items you mention. I have a use case where I want to add a complex button to the upper right in addition to the normal buttons.
+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.
I also would find custom buttons quite useful. Pass an object through containing perhaps the button image, a callback function, and any other metadata like tooltips feels intuitive enough. I suppose though some ordering mechanism would also need to be considered.
Can anyone help me add a custom button/link next to the volume button please?
Can anyone please help me add a toggle button and a dropdown menu like the speed or quality menu inside the settings option. this will really help my website.
@Shuvadip-Ghosh Unfortunately Plyr never supported custom controls. If you are looking for a quick and dirty solution you can hack some additional HTML code into the player controls with JS in plyr.on('ready', ...)
.
It makes little sense however to develop new code against Plyr; it has been unmaintained for a year now. I suggest picking a different video player library that has support for custom controls built-in.
The current array options for buttons and settings has some limitation:
Alternative syntax (boolean to disable, number to change the order):
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.