The stock YouTube app (here on 2.1-eclair, but applies to all android versions) stops playing when I minimised, switched to another application or even when I lock the phone. And when I resume it restart downloading the clip from the beginning. Is there any way that I can play YouTube clips in the background? Note, I only the audio to continue playing.

When you say "2.1" are you referring to the youtube app version or your Android version? I thought youtube was only at 2.0.26.
– MattNov 23 '10 at 17:42

I mean the android version. sorry. how to check the youtube app version?
– Louis RhysNov 23 '10 at 23:12

1

Settings > Application Manager > Applications > YouTube It will show you your current version. On the moto droid the most recent YouTube app allows playback with the screen off now but it still stops when you navigate to another app.
– MattNov 23 '10 at 23:17

13 Answers
13

Here's a solution using entirely free and open source software. The basic idea is that although YouTube can't play clips in the background, VLC for Android can play clips in the background, so all we need to do is pipe the clip to VLC where we can listen to it minimised.

That sounds complicated, but luckily there is software that does it for us.

Now, you can press Home Button and listen in lock screen.
There is also a shortcut for enabling Background Play, which is tapping and holding the Play button, instead of just tapping it to play a video

Update :
Now MX player is not allowing to play youtube videos directly as mentioned by narayanan.

Seems to be a very good idea and +1 from me to make me discover mx players okay from network stream feature. Unfortunately, when tried few video [URLs ](youtu.be/m3KdpzL3Hkk) all I get is an error can't play this link . Does it work for YouTube and if so I have a doubt that it will violate YouTube's terms and conditions.
– NarayananSep 26 '15 at 5:58

Thanks for bringing issue to attention..I have just updated answer now it shoud work..
– Ash-Ishh..Sep 26 '15 at 16:11

TubeMate YouTube Downloader is a great app that will let you download either the audio or the video from a YouTube file and save it to your device. When it is on your device, you are then able to use a media player (such as DoubleTwist) to play either in the background. But as for straight background music from YouTube, that's a no-go :/

You can use firefox and request the desktop site. You can change tabs, open other apps, or turn off the screen. However the desktop site layout is not optimal for mobile firefox. This does not work in chrome or the default ("Standard") browser and it will not play videos that require flash (vevo).

You could also use YouTube Vanced. YouTube Vanced is a modded version of YouTube. It is a feature enhanced version of the official YouTube app, most importantly brings the feature for background playback (as well as other equally useful features including built-in adblocking, black/dark themes, etc).

It officially supports minimum (API 17) version 4.2 jellybean and works on both rooted and non-rooted devices.

This page has installation instructions and download links for non-rooted and rooted devices.

Additionally you need to install the install MicroG package (found in the download links) in order to be able to log into google account (not necessary if you don't want to log in)

Select a video and start playing. Press home button (ofcourse youtube app will close/minimize). With headphones plugged, stay in the home screen, press play/pause button on the headphone itself. Works for me everytime, but only for playing from browser not from YouTube app.

+1 for YMusic, which can play in background (while a different app is is use, e.g. while the user is browsing internet) and with the screen off (some tools that I've used could do the latter but not the former). A similar app is Firetube.
– cipricusMay 20 at 11:47

Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).