vlitejs / vlite

🦋 vLitejs is a fast and lightweight Javascript library for customizing video and audio player in Javascript with a minimalist theme (HTML5, Youtube, Vimeo, Dailymotion)
https://vlite.js.org
MIT License
266 stars 18 forks source link

Custom icons #122

Closed tadaskarpavicius closed 6 months ago

tadaskarpavicius commented 7 months ago

If the feature request is for a plugin or provider, specify it here.

No response

If the feature solves a problem you have, specify it here.

No response

Describe the proposed feature.

Love this plugin, great job! However, one feature I missed greatly is the ability to supply my own svg icons. I know I can go around this in the css, but it is not the same as having svgs in the dom.

Describe alternatives you've considered

No response

Additional context

No response

Related issues

No response

yoriiis commented 6 months ago

Hello @tadaskarpavicius, thanks for the compliment, I appreciate it!

About the issue, it is quite specific as a request. Do you want to change all the icons?

We could consider a SVG icon sprite skippable in the parameter, but that would involve replacing them all in the new sprite, it is not easy to use. Don't hesitate if you have an idea in mind

tadaskarpavicius commented 6 months ago

No, usually just some of them need to be replaced. In my case which prompted to create this ticket, I needed to replace only the Play button. It needed to change color on mouseover which meant that instead of manipulating fill css attribute of my custom icon I had to use two different color svg datauris in my css.

Not really sure what's the right approach. Maybe player config option for custom icon svgs? That seems to be common on the carousel js plugins (a config prop for prev/next button html for example).

But then again, users could do this themselves on the onReady callback, so not sure if this needs to be included. Might go against the "lite" ethos.

yoriiis commented 6 months ago

Yes exactly and it seems quite specific to me especially since you can already update the DOM manually to modify elements. I prefer to close the issue but thank you for the exchange.