Mine started doing the same today :(
When playing music with the headphones plugged in, the headphone icon is not displayed and the sound comes out of the speakers.
I had the software updated yesterday ... which may be the cause
I restarted my phone and also reset to factory settings but...