SDKLauncher-Android
SDKLauncher-Android copied to clipboard
If media overlay is playing, audio doesn't stop when app is backgrounded or device is turned off
There is a bug where media overlay audio doesn't stop playing when the app is backgrounded or the device is turned off.
Repro steps:
- Launch SDKLaunder-Android
- Open a book with a media overlay
- Play the media overlay
- Background the app or touch the power button to turn off the display
Actual results: audio continues playing Expected results: audio stops
One potential fix is to call ReadiumSDK.reader.toggleMediaOverlay() if the media overlay is playing in WebViewActivity.onPause(). Seems to work.
The proposed solution sounds good. Please note that the Readium native application "launchers" are minimalistic by design, so there may be a number of other user experience / device integration issues.
Finally created a pull request for this here: https://github.com/readium/SDKLauncher-Android/pull/74