Headphone music controls not working correctly
The solution lies in your first sentence. You're using an HTC headphone.
Music controls are not standardized so every manufacturer implements them differently. As if this wouldn't be enough, different models have different implementations too. The only headphone that's guaranteed to work is the one that came with your device. 

Apple on the other hand has a certification program to make sure that 3rd party accessories will work with iDevices.