Apple allows very few apps to play audio in the background. The built in Music app is one. Anything playing in the Safari browser will always stop when exiting Safari or when the iPad goes to sleep.
I'm going to assume that this is an app enabled/disabled option.
I know that when I airplay from youtube to my Apple TV as soon as the video starts playing, I can put my phone into sleep mode and the content continues playing on TV without interruption.