I sometimes think this is a hardware issue, since blowing out the bottom connector and earplug connector occasionally helps.
Also, in relation to a Belkin FM car adapter, the problem occurs far more often in warm weather rather than cool weather.
But mostly I think it is a software problem. When I watch a Hulu stream, I have yet to have the sound fail during an ad.
Also, FaceTime seems to work rather flawlessly. And the phone ringer and other system sounds work fine.
As others have noted, I get this mostly while playing QuickTime video, such as following a post from Facebook. And the loss of sound corresponds to the disappearance of the volume controls, sort of like what happens when the Belkin FM is plugged in.
Anyone know if QuickTime uses a different bit of sound code than FaceTime or system sounds?
N.B.: iPhone 4S MD441l/A OS 7.0.4.