[flagged]
Even youtube's app itself doesn't allow that unless you pay. I suspect they've nobbled most browsers into not allowing it, either by technical measures or (more likely) the strong-arm tactic of saying “if you don't block this we'll find a way to make the entire of youtube practically unusable on your browser”.
I've been using Grayjay recently which does allow that, amongst a number of other useful features (integrating other media sources, lack of adverts every few minutes in some content). Might be worth considering as an option.
In iOS kinda yes; you have to request desktop version, and once you activate the lock screen for the first time you have to press “play”. Then it just plays and auto plays in the background.
Don’t know about android, but there is also an extension there that blocks the visibility page api for YouTube.
Why not simply use NewPipe [0]?
You also get ad filtering and you can download Audio/Video streams from within the app.
You can play yt video in firefox with locked screen but you need to use desktop mode
Yes. That's the primary reason I use it, but you have to install an extension called "Video Background Play Fix".
Tubular app does, and it blocks ads
Yes, actually!
Well, it does require you to install an extension[0], but it can be done.
[0]: <https://github.com/mozilla/video-bg-play>