I'm a beginner and I’m working on an android project in which I play youtube videos using Google YouTube data API. Is it possible to play the video in the background even after the user has switched to another app or pressed the home button? Is it possible to separate the audio from the video and stream that in the background? I don't want to use web view.
Pull down the notification shade, and you will see the media controls of the video that you just played. Now simply tap play and your video will start playing in the background.
If you've blocked notifications, the YouTube app might not be able to run smoothly and/or access the internet in the background. If this happens, you'll need to re-enable YouTube notifications at the OS level and, if you still don't want to receive notifications, you can disable them from the YouTube app settings.
It is possible to play the audio in the background. However , you are not allowed to do so.
This violation of the Youtube API is cause for immidiate removal from the play store.
Official answer:
During review, we found that your app violates the Prohibited Actions provision of the Content Policy.
We have determined that your app enables background playing of YouTube videos, which is a violation of the YouTube API Terms of Service: "Your API Client will not, and You will not encourage or create functionality for Your users or other third parties to: (8) separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API;"
youtube red users only they possible to play youtube videos in background (https://support.google.com/youtube/answer/6308116?hl=en). You can check if they have this in the api,
its possible to play youtube videos in background if you open the desktop version of youtube in a browser. Maybe you can make use of this by opening the correct link in a webview in background
Yes its possible and its easy. No installation, no root, no violations. Let me explain it.
Andriod 9 --> Settings --> Search Picture in Picture --> select YouTube --> Allow
Once Allow picture-in-picture is enabled. You can run YouTube in Background.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With