Android媒体播放器是否有任何通知添加播放/暂停,上一个和下一个按钮等播放器控件的示例?
答案 0 :(得分:0)
// - MediaPlayerControl方法----------------------------------------- -----------
public void start() {
mediaPlayer.start();
}
public void pause() {
mediaPlayer.pause();
}
public int getDuration() {
return mediaPlayer.getDuration();
}
public int getCurrentPosition() {
return mediaPlayer.getCurrentPosition();
}
public void seekTo(int i) {
mediaPlayer.seekTo(i);
}
public boolean isPlaying() {
return mediaPlayer.isPlaying();
}
public int getBufferPercentage() {
return 0;
}
public boolean canPause() {
return true;
}
public boolean canSeekBackward() {
return true;
}
public boolean canSeekForward() {
return true;
}
答案 1 :(得分:0)
MediaController mediaController = new MediaController(this);
VideoView.setMediaController(mediaController);
使用MediaController?