I'm running YouTube in the browser and it stops playing the video if you lock the screen. This worked on my old phone.
Also, the screen timeout stops videos from playing on new phone only.
I have tried it with multiple browsers and other video sites with the same results, i.e. works on old phone but not new.
Both phones use the latest OS version. I assume/hope this is related to some setting rather than hardware?