From 5f5218fc3392b51bc8c9cb52abfb136be710464a Mon Sep 17 00:00:00 2001 From: Timothy Shamilov Date: Thu, 28 Jun 2018 02:56:24 -0400 Subject: [PATCH] iOS allows background audio & Android audio can autoclose (#136) * Android audio should autoclose if variable is set. * Enabling iOS background audio. --- plugin.xml | 6 ++++++ .../cordova/plugins/streamingmedia/SimpleAudioStream.java | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugin.xml b/plugin.xml index 2db613e..33544b2 100755 --- a/plugin.xml +++ b/plugin.xml @@ -36,6 +36,12 @@ + + + audio + fetch + + diff --git a/src/android/com/hutchind/cordova/plugins/streamingmedia/SimpleAudioStream.java b/src/android/com/hutchind/cordova/plugins/streamingmedia/SimpleAudioStream.java index f9017d5..9ef06e4 100755 --- a/src/android/com/hutchind/cordova/plugins/streamingmedia/SimpleAudioStream.java +++ b/src/android/com/hutchind/cordova/plugins/streamingmedia/SimpleAudioStream.java @@ -16,7 +16,6 @@ import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.MediaController; -import android.os.PowerManager; public class SimpleAudioStream extends Activity implements MediaPlayer.OnCompletionListener, MediaPlayer.OnPreparedListener, @@ -40,8 +39,7 @@ public void onCreate(Bundle icicle) { String backgroundColor = b.getString("bgColor"); String backgroundImagePath = b.getString("bgImage"); String backgroundImageScale = b.getString("bgImageScale"); - mShouldAutoClose = b.getBoolean("shouldAutoClose"); - mShouldAutoClose = mShouldAutoClose == null ? true : mShouldAutoClose; + mShouldAutoClose = b.getBoolean("shouldAutoClose", true); backgroundImageScale = backgroundImageScale == null ? "center" : backgroundImageScale.toLowerCase(); ImageView.ScaleType bgImageScaleType; // Default background to black