When you want to listen to a song on the fly from your computer, the first thing you do is open Youtube and search for it there (although there are streaming music sites like Spotify that work even better). The same can be done from your smartphone or tablet even if there is a problem with the Youtube app.
It becomes impossible, in fact, listen to only one song with Youtube without video. In other words, you can't just hear music and turn off the phone screen, which would also be great for not letting the battery drain too quickly.
Until some time ago there were some apps to be able to hear Youtube in the background, without keeping the video or application in the foreground on the screen, but they were withdrawn by Google because in contrast with the rules of Youtube.
Replace Android phone there is however a trick ingenious, which violates no rules, to turn off the screen without stopping listening to music on Youtube.
The trick is really trivial and simple, you just need to open Youtube not from the application, but using the browser and in desktop version This trick works with Firefox per Android and also with Google Chrome.
In Chrome, open the website www.youtube.com and then press the button with three dots to ask for load the desktop version. From the desktop version of Youtube, start a music video and then turn off the screen. The audio will stop the first time but just turn the screen back on and notice the Chrome notification with the ability to press the Play button.
By pressing the Play button, it will be possible listen to music from Youtube even when the screen is off.
Wanting to use Firefox, it's possible install an addon named Video Background Play Fix which works on Youtube and also on other sites, preventing the interruption of the video when the screen is off.
Then open the video from Firefox, then press the Home button of the Android smartphone to return to the main screen and notice that the video does not stop playing, even if it remains in the background. If you turn off the phone, the video still plays.
Basically, having a cover (not magnetic) that covers the screen or putting the phone in your pocket, the screen turns off, but Youtube does not stop. The playback of the video, therefore, is not interrupted and only the audio can be heard. This way you can listen to a YouTube playlist and put your phone in your pocket or face down to listen to music while consuming far less power than if it were on.
Of course the traffic consumption, in the case of a data connection, remains high so this is not a way to save data bandwidth. This method is safe, simple, and doesn't require root access to the phone.
Alternatively, a more solid trick that definitely works to open Youtube videos in the background even when the screen is off is to use VLC per Android.
Open the YouTube app and play the video of the song or speech you want to listen to in the background.
On the video playback page, tap the Share button and then choose "play with VLC". VLC media player will open the chosen video.
Now the trick is to tap the Options button in VLC (the three horizontal dots in the lower right corner) and then press "Play as audio". The audio will play in the background and will continue even if you turn off the screen or lock your phone. Unfortunately, this trick doesn't allow you to import YouTube playlists. therefore, you will need to open the videos one by one.
Who has a Xiaomi smartphone, can listen to Youtube audio only using an internal option of the system, therefore without installing different apps.
In Settings -> Special Features -> Video Tools -> Manage Video Apps, enter the YouTube app among the managed ones. When you open the YouTube app, a small slid also appears on the left next to the video (you can barely see it) which allows you to play the videos in the background.
A different trick had also been found for listen to Youtube music from iPhone or iPad in the background