MediaPlayer Time Format
// See below site
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=core/java/android/widget/MediaController.java;hb=71beeab14a891297b6658c4aeb47557083091aa1
int position = mediaPlayer.getCurrentPosition();
int duration = mediaPlayer.getDuration();
int timeMs = position;
or
int timeMs = duration;
int totalSeconds = timeMs / 1000;
int seconds = totalSeconds % 60;
int minutes = (totalSeconds / 60) % 60;
int hours = totalSeconds / 3600;
-----
Cheers,
June
수요일, 8월 11, 2010
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기