Skip to content

Commit

Permalink
iOS allows background audio & Android audio can autoclose (#136)
Browse files Browse the repository at this point in the history
* Android audio should autoclose if variable is set.

* Enabling iOS background audio.
  • Loading branch information
shamilovtim authored Jun 28, 2018
1 parent 41aeb1a commit 5f5218f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
<param name="ios-package" value="StreamingMedia" />
</feature>
</config-file>
<config-file target="*-Info.plist" parent="UIBackgroundModes">
<array>
<string>audio</string>
<string>fetch</string>
</array>
</config-file>
<header-file src="src/ios/StreamingMedia.h" />
<source-file src="src/ios/StreamingMedia.m" />
<header-file src="src/ios/LandscapeVideo.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 5f5218f

Please sign in to comment.