YouTube is a great source for music videos, and you can basically ditch your Spotify or iTunes Radio and ‘listen’ to music all-day via YouTube playlists. The annoyance is YouTube needs to be the front running app, and once you put your iPhone to sleep, the music stops.
Here’s a workaround. First don’t use the standalone YouTube app from Google. Instead access YouTube.com website on Safari or Chrome, and play the music video inside the browser.
Once the music video has started, do not stop or pause the player, and put your iPhone to sleep by using the Wake/Sleep button. The music will stop as expected when the screen is off.
Turn on your iPhone now, and you will see the media playback control at top of the unlock screen.
Tap the “Play” icon to continue playing the YouTube music video in the background while your iPhone’s screen is switched off.