Problem with music pausing
You said that when you plug in the earphones the music pauses and when you resume it starts playing on the phone speaker.
That is because the connection between your earphones and the headphone jack in your mobile isn't established.
The main reasons behind this is maybe there is some dirt in the headphone jack. You can remove it with an earbud.
In some other cases usually the headphone jack is damaged and needs to be replaced. I have this same issue and I didn't find any solution to this. So I bought a pair of bluetooth headphones.