Created
October 20, 2013 19:47
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
public void onBufferingUpdate(MediaPlayer mp, int bufferedPercent) { | |
statusView.setText("MediaPlayer Buffering: " + bufferedPercent + "%"); | |
Log.v(LOGTAG, "MediaPlayer Buffering: " + bufferedPercent + "%"); | |
} | |
public boolean canPause() { | |
return true; | |
} | |
public boolean canSeekBackward() { | |
return true; | |
} | |
public boolean canSeekForward() { | |
} | |
public int getBufferPercentage() { | |
return 0; | |
} | |
public int getCurrentPosition() { | |
return mediaPlayer.getCurrentPosition(); | |
} | |
public int getDuration() { | |
return mediaPlayer.getDuration(); | |
} | |
public boolean isPlaying() { | |
return mediaPlayer.isPlaying(); | |
} | |
public void pause() { | |
if (mediaPlayer.isPlaying()) { | |
mediaPlayer.pause(); | |
} | |
} | |
public void seekTo(int pos) { | |
mediaPlayer.seekTo(pos); | |
} | |
public void start() { | |
mediaPlayer.start(); | |
} | |
@Override | |
public boolean onTouchEvent(MotionEvent ev) { | |
if (controller.isShowing()) { | |
controller.hide(); | |
} else { | |
controller.show(); | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment