Iphone sound won't play out loud only in headphones

I just got my iphone yesterday and put some music on it, last night i was listening to it out loud and it was working fine but this morning it doesn't won't to play outloud!
If i move it a little bit the music will play but then go to silet 30 seconds later?

Restart the phone, if that doesn't work contact apple. If they approve that the phone is bugged, they send you a new one in literally 2 days. My old iphone's home button stopped and they sent a new one wothout questions!