Back to project page AudioChoice.
The source code is released under:
Apache License
If you think the Android project AudioChoice listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.hwrdprkns.audiochoice; //from w w w . j a v a 2 s . c o m import android.content.Context; import android.util.Log; import java.io.IOException; public class BasicStreamMediaPlayer extends BasicMediaPlayer { private final static String TAG = BasicStreamMediaPlayer.class.getSimpleName(); private final static String WILDFIRE = "https://dl.dropboxusercontent.com/u/4676303/wildfire.mp3"; public BasicStreamMediaPlayer(Context context, IPlayerView playerView) { super(context, playerView); } @Override public void start() { if (getMediaPlayer().isPlaying()) return; try { shouldBePlaying = true; if (!isPrepared) { getMediaPlayer().setDataSource(getStreamUri()); getMediaPlayer().prepareAsync(); } else { getMediaPlayer().start(); } } catch (IOException e) { Log.d(TAG, "Exception when starting" + e.getMessage()); } } protected String getStreamUri() { return WILDFIRE; } }