I'm trying to create a custom music player UI for a site. It's not playing any real audio files so I won't be using HTML's Audio features.
It's actually just going to be playing some youtube video in the background, but I'd like to create my own music player interface for it.
I'd like to know how to create a custom trackbar, that will know where a user clicks on.
For example, if I have a div that's 20px high, and 500px wide to represent the trackbar, and the user clicks on a certain part of it, how can I get that value relative to the div?
Youtube comes with an API that allows you to skip to a certain part of the song, but I'd first have to get the value (in pixels) of where the user clicked, and then run some simple math to convert it to a time.
Hopefully my question's understandable. I can provide additional details as needed.
Thanks!