On iPhone, most music apps let you play music in the background. After all, they'd be virtually useless if they couldn't. For video apps that's not the case which - again - makes sense, since you can't watch videos with your iPhone locked and the phone in standby.
With YouTube, the app is a sort-of two-in-one platform that offers videos and, with that, music videos which is a surprisingly popular way to consume music these days. You can find podcast episodes and concerts on there too.
Now, YouTube does let you use its video app to play music in the background but there's a caveat: you need to be a Premium subscriber in order to take advantage of that feature. Of course, you can use the YouTube Music app, but again, you need to be a subscriber for that too.
At this point when you go back to your home screen, or lock your phone, the music will stop becuase the video stops playing. However, you can easily get it playing again, without going back to the browser.
Once you've done that and you drop Control Centre, you should see the option to play the music again. Once it's playing, you can lock your phone, and play and pause it from the lockscreen control or just go about your business using other apps on the phone.
It's worth noting, if you're in a playlist or queue, it doesn't seem to automatically continue to the next song, so you do need to re-open Safari to choose a new song when one ends. Thankfully, YouTube is full of long compilations and live concerts, and you can easily find 'videos' over an hour long.
d3342ee215