diff --git a/android/src/main/java/com/leblaaanc/RNStreamingKitManager/RNStreamingKitManagerModule.java b/android/src/main/java/com/leblaaanc/RNStreamingKitManager/RNStreamingKitManagerModule.java index 735a703..2d8a435 100644 --- a/android/src/main/java/com/leblaaanc/RNStreamingKitManager/RNStreamingKitManagerModule.java +++ b/android/src/main/java/com/leblaaanc/RNStreamingKitManager/RNStreamingKitManagerModule.java @@ -48,6 +48,7 @@ public class RNStreamingKitManagerModule extends ReactContextBaseJavaModule impl volatile boolean _isPaused; volatile boolean _isBuffering; + volatile boolean _isCall; AudioManager _audioManager; ; @@ -136,6 +137,10 @@ public void pause() @ReactMethod public void resume() { + if(_isCall) { + _isCall = false; + return; + } Log.d(NAME, "==> resume"); if (!isMusicPlaying()) { startPlaying(); @@ -270,12 +275,14 @@ public void onAudioFocusChange(int focusChange) { break; case AudioManager.AUDIOFOCUS_GAIN: Log.d(NAME, "==> Audio Session Interruption case AUDIOFOCUS_GAIN."); - resume(); +// not calling resume as the media manager will also do that +// resume(); notifyAudioInterruption("interruptEnd"); break; case AudioManager.AUDIOFOCUS_LOSS: //_audioManager.abandonAudioFocus(afChangeListener); Log.d(NAME, "==> Audio Session Interruption case AUDIOFOCUS_LOSS."); + _isCall = true; stop(); break; default: