Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class RNStreamingKitManagerModule extends ReactContextBaseJavaModule impl

volatile boolean _isPaused;
volatile boolean _isBuffering;
volatile boolean _isCall;
AudioManager _audioManager;
;

Expand Down Expand Up @@ -136,6 +137,10 @@ public void pause()

@ReactMethod
public void resume() {
if(_isCall) {
_isCall = false;
return;
}
Log.d(NAME, "==> resume");
if (!isMusicPlaying()) {
startPlaying();
Expand Down Expand Up @@ -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:
Expand Down