Airplay from Safari stops when iPhone/iPad sleeps
So I updated my iPhone and iPad to iOS 9. Ever since doing so, I have been having an annoying issue with AirPlaying videos from Safari to Apple TV. When I Airplay the video from Safari to ATV, it works, but as soon as I lock my iPhone/iPad the Airplay stops. Is it just me or anybody else with the same issue? I'm not really keen on leaving my iPhone on all the time, I would like the video to play through AirPlay from Safari on my iPhone even when it is locked.
Is this how it is going to be in iOS 9 now or it's a glitch.
Note: Apple TV is running on the latest iOS too.
iPhone 6 Plus, iOS 9