Hi there, same problem here!
Also the music sometimes stopped playing while headphones plugged in and phone was moving.
Following solution seems to work for me:
Inside the audioplug on the top is a metal piece. This was bent to the side so there was no firm connection to the audiojack anymore. I bent it back a little bit, now everything seems to work fine.
I opened the phone an took out the top module to fix it, but i think it can also be fixed without opening the phone.
See image attached illustrating the problem/metal thing:
Markus