How to pause youtube video when click on power button

#1

I’m trying to upload my app on google play but they always reject it.

When I asked them, the reason of rejection was pointed on “youtube videos not pause when the screen off”

I checked some solutions but its not supported on ionic… please try to help me to solve this issue

#2

The screen can turn off more ways than just the power button. You can detect if the app gains or loses focus by listening for ‘pause’ and ‘resume’.

  document.addEventListener("pause", () => {

  }, false);

  document.addEventListener("resume", () => {

  }, false);

You can also subscribe to these events:
platform.pause.subscribe(…

1 Like
#3

Solution is work… :heart_eyes: