@@ -31,7 +31,7 @@ public class RNSoundModule extends ReactContextBaseJavaModule implements AudioMa
3131 ReactApplicationContext context ;
3232 final static Object NULL = null ;
3333 String category ;
34- Boolean mixWithOthers = true ;
34+ Boolean duckAudio = true ;
3535 Double focusedPlayerKey ;
3636 Boolean wasPlayingBeforeFocusChange = false ;
3737
@@ -236,10 +236,10 @@ public void play(final Double key, final Callback callback) {
236236 }
237237
238238 // Request audio focus in Android system
239- if (!this .mixWithOthers ) {
239+ if (!this .duckAudio ) {
240240 AudioManager audioManager = (AudioManager ) context .getSystemService (Context .AUDIO_SERVICE );
241241
242- audioManager .requestAudioFocus (this , AudioManager . STREAM_MUSIC , AudioManager . AUDIOFOCUS_GAIN );
242+ audioManager .abandonAudioFocus (this );
243243
244244 this .focusedPlayerKey = key ;
245245 }else {
@@ -308,7 +308,7 @@ public void stop(final Double key, final Callback callback) {
308308 }
309309
310310 // Release audio focus in Android system
311- if (!this .mixWithOthers && key == this .focusedPlayerKey ) {
311+ if (!this .duckAudio && key == this .focusedPlayerKey ) {
312312 AudioManager audioManager = (AudioManager ) context .getSystemService (Context .AUDIO_SERVICE );
313313 audioManager .abandonAudioFocus (this );
314314 }
@@ -333,7 +333,7 @@ public void release(final Double key) {
333333 this .playerPool .remove (key );
334334
335335 // Release audio focus in Android system
336- if (!this .mixWithOthers && key == this .focusedPlayerKey ) {
336+ if (!this .duckAudio && key == this .focusedPlayerKey ) {
337337 AudioManager audioManager = (AudioManager ) context .getSystemService (Context .AUDIO_SERVICE );
338338 audioManager .abandonAudioFocus (this );
339339 }
@@ -452,11 +452,11 @@ public void setSpeakerphoneOn(final Double key, final Boolean speaker) {
452452 }
453453
454454 @ ReactMethod
455- public void setCategory (final String category , final Boolean mixWithOthers ) {
455+ public void setCategory (final String category , final Boolean duckAudio ) {
456456 this .category = category ;
457- this .mixWithOthers = mixWithOthers ;
457+ this .duckAudio = duckAudio ;
458458
459- if (!this .mixWithOthers ){
459+ if (!this .duckAudio ){
460460 AudioManager audioManager = (AudioManager ) context .getSystemService (Context .AUDIO_SERVICE );
461461 audioManager .abandonAudioFocus (this );
462462 }
@@ -465,7 +465,7 @@ public void setCategory(final String category, final Boolean mixWithOthers) {
465465
466466 @ Override
467467 public void onAudioFocusChange (int focusChange ) {
468- if (!this .mixWithOthers ) {
468+ if (!this .duckAudio ) {
469469 MediaPlayer player = this .playerPool .get (this .focusedPlayerKey );
470470
471471 if (player != null ) {
0 commit comments