I have a little problem that I need to install on a very basic Android demo application in Ionic 2.
When a Youtube video is played on the home page, if you press the power button or the phone goes into sleep / lock mode, the Youtube video will continue to play. This problem causes Google to reject the application in the Play Store, as they do not allow this to happen on Youtube.
Therefore, I need to add a code to pause the video if the state changes and resumes when I wake up again.
The function I need to add seems to be called onPause and onResume, but I'm not sure how and where to add the code to make this function work with this custom Youtube code.
Here are the files in the repo, and the APK (only 3 MB) is just a change on the home page when installing empty ionic 2, where you can see the problem in action.
Github Repo
APK on Github
source
share