angular-youtube-embed
angular-youtube-embed copied to clipboard
Rejected from the Play Store
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?
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();
});
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.
I gave up... for now. But I would still love to figure it out. The App is ready except for the video!
have you seen this issue?
maybe you could listen for a blur
event on window
, and with a player reference, pause the video
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.
Make sure you assign a blank page or the original url to your embedded video webview onPause. The WebView will keep playing otherwise.
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 Where exactly do you place this code?
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 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
@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 No, I couldn't Make it work. I feel super lost.
Ok @Darksyntax let try and I keep you in touch 👍
Thanks!
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