Search code examples
androidyoutube-apigoogle-playandroid-mediaplayerandroid-youtube-api

How To Play YouTube Videos In The Background?


I happened to see an application that allows me to minimize and play YouTube videos in the background. I know that the YouTube terms of service does not allow this. However, this app is not banned yet. Why are they not banned and how are they doing this?

Link to Play Tube


Solution

    • They are using TYPE_APPLICATION_OVERLAY, that is why they require your "android.permission.SYSTEM_ALERT_WINDOW". This would allow them to draw over other apps, while having their app in the "background". It is actually in the foreground.

    • As for displaying the actual YT videos/comments part, well, they just start an intent action view with a youtube link, that's all.

    That covers how they do it.

    As to why they are not banned? I believe it is because they are not actually letting you download any copyrighted material.