breautek commented on issue #299: URL: https://github.com/apache/cordova-plugin-media/issues/299#issuecomment-2778760213
> Here's the fix: > > ``` > diff -ru node_modules/cordova-plugin-media/src/android/AudioHandler.java node_modules/cordova-plugin-media/src/android/AudioHandler.java > --- a/node_modules/cordova-plugin-media/src/android/AudioHandler.java > +++ b/node_modules/cordova-plugin-media/src/android/AudioHandler.java > @@ -267,6 +267,12 @@ > if (players.isEmpty()) { > onLastPlayerReleased(); > } > + > + // This is required in case we release the audio while the system has paused us for e.g. a phone call > + // If we don't, it'll get resumed when the phone call ends, even if we've destroyed the AudioPlayer > + AudioManager am = (AudioManager) this.cordova.getActivity().getSystemService(Context.AUDIO_SERVICE); > + am.abandonAudioFocus(focusChangeListener); > + > audio.destroy(); > return true; > } > ``` PR's are welcome :) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org