How to play on YouTube in the background in Android?

I am new and am working on an android project in which I play YouTube videos using the Google YouTube data API. Is it possible to play video in the background even after the user has switched to another application or pressed the home button? Is it possible to separate audio from video and stream that are in the background? I do not want to use web view.

+7
android youtube-data-api
source share
2 answers

You can play audio in the background. However, you are not allowed to do this.

This violation of the Youtube API is the reason for unimpeded removal from the play store.

Official answer:

During the check, we found that your application violates the provision of prohibited actions in the content policy.

We have determined that your application allows you to play background video on YouTube, which violates the YouTube API Terms of Use: "Your API client will not, and you will not promote or create features for your users or other third parties: (8) share, isolate or modify the audio or video components of any YouTube audiovisual content accessible through the YouTube API; "

+2
source share

youtube red users only they can play youtube videos in the background ( https://support.google.com/youtube/answer/6308116?hl=en ). You can check if they have it in api,

it can be played in the youtube format in the background if you open the desktop version of youtube in a browser. Perhaps you can use this by opening the correct link in a web browser in the background

0
source share

All Articles