Event called when Android app is suspended?

I’ve been looking all over for a way (in blueprints) to have an event triggered when our game is suspended by the player. I would also like an event for when game play is resumed.

Currently, we’re using the media player to play videos in game. But, if the user exits the game (by pushing the home button for example) the media player keeps playing the video. I need to pause/resume the media player as the user suspends/resumes the game.

So far I haven’t found any documentation that tells me how to do this. Any help would be much appreciated.

Thanks,

1 Like

Bump. Does anyone know how to do this? Thanks.

Late response - but here are a number of delegates you can bind to in order to detect when the app gets pushed to the background or deactivates (as well as when the app reactivates or is pushed backed to the foreground).

You can either add a Application Lifecycle Component to some object in your level, or you can use the UPlatformGameInstance class as here:

There are a bunch of delegates here you can bind to, in order to do whatever you need (pause, unpause etc.).

1 Like

UPlatformGameInstance looks perfect! Unfortunately, we’ve already shipped.