Guest User

Untitled

a guest
Jun 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. // called from the main activity
  2. synchronized public void playPause(Context _c, String _s) {
  3. if (mediaPlayer == null) {
  4. // show progress dialog
  5. pd = ProgressDialog.show(_c, "Raw Audio", "connecting to stream...", true, true);
  6.  
  7. // not playing -> load stream
  8. STREAM = _s;
  9. loadStream();
  10. }
  11. else if (mediaPlayer.isPlaying()) {
  12. // playing -> pause
  13. mediaPlayer.pause();
  14. }
  15. else {
  16. // paused -> resume
  17. mediaPlayer.start();
  18. }
  19. }
Add Comment
Please, Sign In to add comment