Hi all,
I’ve followed this tutorial http://bit.ly/2dXWVAL 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) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
document.addEventListener("pause", onPause, false);
function onPause() {
player.stopVideo();
}
});
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.
Thanks,