It can be a bit buggy at times, but when it comes to just playing music with the screen locked, it’s perfect.
https://addons.mozilla.org/en-US/firefox/addon/video-background-play-fix/
Edit: I forgot to also mention that ad blocker extensions make sailing the seas on mobile much more manageable. Extentions, in general, have been a really nice addition.
For those on iOS: there’s an app called “Vinegar” that replaces the YouTube player with a vanilla HTML5 player that supports background/PiP play without YT Premium.
Alternatively on iPhones with “dynamic island”, minimize Safari while a video is playing, quickly tap-and-hold the dynamic island area and resume playback. After that you can lock your device and audio will continue playing.