YSK: You can install an extension on Firefox (android) that allows you to play YouTube videos with your screen locked: (perfect for listening to obscure music)
It can be a bit buggy at times, but when it comes to just playing music with the screen locked, it's perfect.
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.
I've used most of these and quite frankly they are not good. Each of them quit working randomly or wouldn't play certain tracks and wouldn't get an update for days or weeks, at which point I'd move on to the next and get exactly the same experience. They're FOSS apps, and I'm fairly certain Google is to blame for breaking them, but even so if they are unusable for days or weeks at a time I cannot recommend them.
If you just want a YouTube app with no ads and background playback I would recommend PipePipe. It's what I've settled on after trying everything else, and it's fantastic. Google breaks it all the time, but updates very quickly bring it back online.
If you want something FOSS that's closer to the YT Music experience, I don't know what to tell you.
RiMusic is update regularly, no third party player is perfect, even PipiPipe or Newpipe can break suddenly, Google/YouTube don't like third party apps using their services and are always implementing ways to break apps
I'm pretty sure extensions can request browsing data for some specific URLs rather than every site you visit. If an extension with functionality on one website asks for access to all of them, then yeah it's a bad sign.
BE WARNED. These extensions are a prime target for purchase and/or hijacking by malicious threat actors, who then use them to gain persistence on your browsers and steal data. There is no reason to increase your browser attack surface for this feature when better alternatives have been posted in this thread.
To top up your comment, you can get the permissions required for each extension in Firefox for Android.
Extension Manager --> click the extension --> Permissions
In the case of this specific extension, it requires access to the data of only 3 domains :
That was my thought.. I was thinking "I already do this without an extension", so I had to verify that I wasn't using an extension that I forgot about.
And for everyone else who doesn't want extra garbage on their phone it's: switch to 'Desktop Site' > continue doing whatever else. This applies to both Firefox and Firefox Focus
No need promote/install more unnecessary stuff on your phones 🤦
Edit- that being said, I still include no script/ublock in FF and use FFF for yt videos when I don't want to clog my Tubular history (newpipe fork with sponsor block) with useless stuff that I'll never want to rewatch.
Yeah. For me the video stops when I lock the screen (or change apps) but I can then press play again on the lock screen (or in the drop down notifications when changed to another app).
I also use it to listen to podcasts/ lore videos without having my screen on when I'm falling asleep. It's also nice for driving. If you make a playlist and have an ad blocker, it WILL continue on to the next song.
I'm actually thinking of forking Firefox and making a lite version mostly geared towards playing YouTube content without ads and without restrictions.
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.