Chosen Solution

Im using iphone 6+. I plugged in my earphone by the music still playing and not thru the earphone. The current earphone im using used to be okay. But suddenly this happens

Either the earphone jack needs to be cleaned with something like a cotton swab with 99% alcohol or the charging port assembly which has the headphone jack on it needs to be replaced. The deepest part of the headphone jack is used to detect headphones so make sure that it is clean.