How do you transfer your iPhone music library to an HTC 1 m8
Simple way. Hook the new device up to your computer.
As it shows up as another drive letter, go into your music folder and scroll down to iTunes music library simply do a select all, copy and then go to the new drive (phone) and go to the music folder and right click and select paste.
All music will be now on the new phone.
Do not do a cut and paste. Just in case you have a problem you won't lose your music off the computer.
Good Luck
One option is to upload the library to the Google Play Music on the web.