How to pause or stop ionic youtube app playing in the background

Hi all,

I’ve followed this tutorial and created and ionic youtube app. Then, I’ve submitted it to Google Play.

Ta taa! App rejected.

I’m using this snippet

$ionicPlatform.ready(function() {
if(window.cordova && window.cordova.plugins.Keyboard) {
if(window.StatusBar) {
document.addEventListener("pause", onPause, false);
function onPause() {

But it didn’t work. I want to stop playing in the background when I press home and screen lock buttons on my phone.
Also, I put an alert on onPause() function to control it’s fired or not. I’m seeing alert popup when I press my screen lock button. But video not pause/stop when I press home button or screen lock button.

Any help would be appreciated.



Is this issue resolved for you? Even my app is rejected for the same reason. I have youtube url embed in the app.

Thanks in advance


Any luck with this? My app was also rejected because of the same issue

I am having the same issue myself. Has anyone solved this?