If this is specifically implemented this way, maybe you could transform this into a feature request for a temporary override.
Maybe a switch that disables this behavior until… Page change, browser close, switch toggle
I can confirm this behaviour. You play a song on youtube with sailfish browser, and when the lockscreen appears, the music goes off. I think the actual behaviour would be, the music plays in the browser, and if lockscreen is activated continues to play on the lockscreen. I cannot reproduce it, but on some newspaper pages this actually happens, the lockscreen shows a play sign, to continue playing. Maybe this depends on the video format…
Here is what i meant, for some news sites you can play the media from the lockscreen for others not. Probably it has to do with the format, but it seems like an inconsistancy