diff --git a/src/android/NativeAudio.java b/src/android/NativeAudio.java index e22f07a9..64160097 100644 --- a/src/android/NativeAudio.java +++ b/src/android/NativeAudio.java @@ -201,14 +201,6 @@ private PluginResult executeSetVolumeForComplexAsset(JSONArray data) { } @Override protected void pluginInitialize() { - AudioManager am = (AudioManager)cordova.getActivity().getSystemService(Context.AUDIO_SERVICE); - - int result = am.requestAudioFocus(this, - // Use the music stream. - AudioManager.STREAM_MUSIC, - // Request permanent focus. - AudioManager.AUDIOFOCUS_GAIN); - // Allow android to receive the volume events this.webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_VOLUME_DOWN, false); this.webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_VOLUME_UP, false); diff --git a/src/ios/NativeAudio.m b/src/ios/NativeAudio.m index e797d1c9..35747429 100644 --- a/src/ios/NativeAudio.m +++ b/src/ios/NativeAudio.m @@ -29,10 +29,8 @@ - (void)pluginInitialize { self.fadeMusic = NO; - AudioSessionInitialize(NULL, NULL, nil , nil); AVAudioSession *session = [AVAudioSession sharedInstance]; // we activate the audio session after the options to mix with others is set - [session setActive: NO error: nil]; NSError *setCategoryError = nil; // Allows the application to mix its audio with audio from other apps. @@ -43,9 +41,6 @@ - (void)pluginInitialize NSLog (@"Error setting audio session category."); return; } - - [session setActive: YES error: nil]; - [session setCategory:AVAudioSessionCategoryPlayback error:nil]; } - (void) parseOptions:(NSDictionary*) options