Can't listen to music on iPhone 4s with headphones?

And the problem is not the headphones. They work totally fine, its the phone I think. I tried many other headphones and it still doesn't work. The speakers and microphone on the phone work as well. At first i thought it was the headphones, but no. It starts workin for
Like a minute when i shake it or hold it in some way but overall it doesn't. What could this be?

Since the iPhone 4S hasn't even come out a year old yet, I KNOW for a FACT that you still have warranty on the iPhone. Go to the Apple store. It's a possible defect… They'll replace it for you for free: D