It's really hard to say what it might be. You say that the sound is OK after you restart the iPad and then log back in again. Something else that you can try is to close all apps and reboot your iPad. Then launch YouTube and just use that for a while and see if that makes a difference. And I don't mean to not use any other apps at all. I mean use YouTube for a period of time before you launch another app. See what happens.
Close all apps and reboot ...
Tap the home button once. Then tap the home button twice and the recents tray will appear at the bottom of the screen. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button twice.
Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.
Settings>General>About>Version will tall you wat iOS you are running. iOS 6.1.3 is the most recent for the iPad2, the iPad with Retina display and the iPad Mini.s