How to stop audio when FireTV switches to screensaver
We've got a problem with our Unity game; when the device switches to the screensaver, the in-game music should stop playing, but it does not. We don't have any idea how to tell the game to shut off the music. Is there any signal from the device that the game can listen for?
I have not tried it yet, but I assume that the app becomes the background process when the screensaver starts. So that may be something to check for. I actually disabled the screensaver for my game to get around any screensaver related issues like this.
Fire TV is essentially an Android API level 17 device (4.2). The screensaver will call onWindowFocusChanged(boolean) on the point in which it is turned on. You can implement that callback in their activity to be able to pause your app gracefully when this happens. Thanks.
As far as I know Unity3d does not have access to this function. At this point there seems to be no possible way for a Unity3d game that uses sound to be certifiable on the Fire TV. Please add an exception for this requirement as was done for the Media button requirement.
There is already an exception for this. I was given the following feedback for my app. Observation:- App continues to play audio after the system enters screen saver or standby mode (exception is granted for music apps) : Ensure that the app stops playing audio once the device begins displaying a screen saver (dream state) or enters standby mode. Note that if your app uses a framework such as Unity, you may ignore this requirement, as apps built on Unity3D do not receive DreamService intents.