I'm also aware of the problem with my code but since it's working fine and I'm just too lazy to sort thing out I guess it's kinda turn into a mess in there somewhere
Anyway, I've made a github page for the player here: https://github.com/xellosp/kamihime-player