Last active
December 22, 2015 08:30
-
-
Save jpzhu/6445134 to your computer and use it in GitHub Desktop.
mp3 player android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.media.MediaPlayer; | |
//Create a MediaPlayer Object | |
MediaPlayer mMediaPlayer = new MediaPlayer(); | |
//Prepare the data for player | |
//This take some time, maybe used in an asynctask() | |
// streami type could be "Uri" or "String" | |
mMediaPlayer.setDataSource(stream); | |
mMediaPlayer.prepare(); | |
// start or stop | |
mMediaPlayer.start(); | |
mMediaPlayer.start(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment