Google play rejected my app

I have an application with many iframe youtube inside, I submited to google store but it is rejected with this message.

Your recent app submission was rejected for violating the Device and Network Abuse policy. Before submitting your app for another review, read through the policy and modify your app to make sure it doesn’t enable background play of YouTube videos. If you submitted an update, the previous version of your app is still live on Google Play.

Anyone help?
Thank you

Have you looked at this

Seems straight forward to me. Regarding automatically playing videos in the background is not permitted as part of their policy so you may have to adapt your App. Thinking about how best to present content to the user without automatically playing (and downloading) content without them initiating it. This is to prevent unnecessary use of data if the user was browsing using data and not WIFI, therefore, possibly being charged. Just modify your app and you should be good. I would also read the policy to make sure you’re complying with everything.

Google just told me that the problem is when you hit the power button when playing your video. The screen will turn off but you also must stop your video playing.

Do you have any solution for this?
Stop playing youtube when click power button on android?
Thank you so much

This does not appear to be a hype specific issue!

Have you asked over on

When we get more information ... it becomes clearer what you need :smiley:

@MarkHunte is right. This isn't a Hype issue but, in order to see whether an app (and I'm assuming you're using Cordova/Phonegap to create your app for android) is in the background or the state has changed you need to use some Javascript to detect these changes and then check to see if video is playing and pause it. That should satisfy Google.

Can't give you anymore as I'm unsure of how you have everything setup. But you want to look for this kind of approach.

// add a listener event for "deviceready" and call the function
document.addEventListener("deviceready", onDeviceReady, false);

// device APIs are available
//
function onDeviceReady() {
    document.addEventListener("pause", onPause, false);
    document.addEventListener("resume", onResume, false);
}

function onPause() {
    // Handle the pause event
    // Here is where you would place code to pause youtube video ex.
    // player.pauseVideo();
}

function onResume() {
    // Handle the resume event
}

The above Javascript is to listen for "deviceready" event and when ready add more listeners to detect changes in your device. Normally when shifting to background the "pause" event is fired. Here you can then run Javascript to pause the video (or stop)

This is the idea but it's not tested and as mentioned ... your setup is not known. :wink:

Both Apple and Google have rejected the app; it is hard for anyone here to know why without seeing it, but you may want to reconsider if an app is the correct format for your content.