Add a custom attribute?

From within a component (media_player in my case), how can I add a custom attribute (ex. username, IP address)?