Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // called from the main activity
- synchronized public void playPause(Context _c, String _s) {
- if (mediaPlayer == null) {
- // show progress dialog
- pd = ProgressDialog.show(_c, "Raw Audio", "connecting to stream...", true, true);
- // not playing -> load stream
- STREAM = _s;
- loadStream();
- }
- else if (mediaPlayer.isPlaying()) {
- // playing -> pause
- mediaPlayer.pause();
- }
- else {
- // paused -> resume
- mediaPlayer.start();
- }
- }
Add Comment
Please, Sign In to add comment