angular-youtube-embed icon indicating copy to clipboard operation
angular-youtube-embed copied to clipboard

Rejected from the Play Store

Open poornerd opened this issue 9 years ago • 15 comments

I am using this in an ionic hybrid app, and it got rejected for this reason:

REASON FOR REJECTION:Violation of the Prohibited Actions provision of the Content Policy.

After a regular review, 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;”

I am playing the video simply, like this: <youtube-video video-id="videoId" player="yt_video" player-vars="playerVars"></youtube-video>

Does anyone know what I need to do to avoid being rejected?

poornerd avatar Nov 13 '15 10:11 poornerd

Did you ever figure this out?

I've added an event listener for state change, and when a user changes tabs or selects a different page from the side menu, it pauses the player.

Note: the following code is placed within a separate event listener I have that fires when the player is playing.

 $scope.$on('$stateChangeStart',
            function (event, toState, toParams, fromState, fromParams, options) {
                console.log('statechanged');
                player.stopVideo();
            });

AtomSub avatar Feb 08 '16 02:02 AtomSub

I have the same problem. I got a response from the google team: "To be more specific, once you exit out of your application the video still plays in the background on the device. This is a violation of our content policy."

I cannot reproduce this behavior. My app always stops the video when losing focus. It seems that they detect something, hidden to my app.

RogerSchmidlin avatar Mar 11 '16 07:03 RogerSchmidlin

I gave up... for now. But I would still love to figure it out. The App is ready except for the video!

poornerd avatar Mar 11 '16 07:03 poornerd

have you seen this issue?

maybe you could listen for a blur event on window, and with a player reference, pause the video

brandly avatar Mar 11 '16 18:03 brandly

I can get the player to stop the video just fine onClick, but it will not work onPause. I know the onPause is firing when user presses the home button, but the player will not stop.

mattspaulding avatar Apr 17 '16 05:04 mattspaulding

Make sure you assign a blank page or the original url to your embedded video webview onPause. The WebView will keep playing otherwise.

RogerSchmidlin avatar Apr 17 '16 06:04 RogerSchmidlin

Hi everyone, for those who have rejected them from the Play Store for "YouTube background play when the screen is off." or because the player still playing in background I solved with the following: When the player is ready I assign the player to a root scope variable:

$scope.$on('youtube.player.ready', function ($event, player) {
  $rootScope.YTPlayer = player;
});

and then i just listening the onPause of the android life cycle and stop de video:

document.addEventListener("pause", function() {
  if ($rootScope.YTPlayer) {
    $rootScope.YTPlayer.stopVideo();
  }
}, false);

Greetings !

JoxieMedina avatar Nov 01 '16 16:11 JoxieMedina

@JoxieMedina Where exactly do you place this code?

ghost avatar Nov 30 '16 18:11 ghost

Hi @Darksyntax the first one is placed in the controller, in were you use the player, and the second one is placed in the run function in the app.js file I hope this was useful :+1:

JoxieMedina avatar Nov 30 '16 19:11 JoxieMedina

@JoxieMedina I hope it will be I followed this unrelated youtube solution for ionic and YouTube and it did not have this piece and breaks the background playing rule : https://github.com/hughred22/Ionic2-Angular2-YouTube-Channel-App

ghost avatar Nov 30 '16 19:11 ghost

@Darksyntax Umm, my solution is for ionic 1, but the concept will be the same, try it and let me know if it works for ionic 2 , you can print logs before submit to the play store, if you can´t make it works let me know to try it in an ionic 2 project.

JoxieMedina avatar Nov 30 '16 19:11 JoxieMedina

@JoxieMedina No, I couldn't Make it work. I feel super lost.

ghost avatar Nov 30 '16 19:11 ghost

Ok @Darksyntax let try and I keep you in touch 👍

JoxieMedina avatar Nov 30 '16 20:11 JoxieMedina

Thanks!

ghost avatar Nov 30 '16 20:11 ghost

Hi @Darksyntax its ready, check out my fork : https://github.com/JoxieMedina/Ionic2-Angular2-YouTube-Channel-App and also I made a pull request to the original repository with the solution functional

JoxieMedina avatar Dec 01 '16 05:12 JoxieMedina