提交 086ef48d 编写于 作者: Z Zhang Rui

MediaController: use long to store duration and position

上级 836cf6bd
......@@ -83,7 +83,7 @@ public class MediaController extends FrameLayout {
private TextView mFileName;
private OutlineTextView mInfoView;
private String mTitle;
private int mDuration;
private long mDuration;
private boolean mShowing;
private boolean mDragging;
private boolean mInstantSeeking = true;
......@@ -385,8 +385,8 @@ public class MediaController extends FrameLayout {
return position;
}
private static String generateTime(int position) {
int totalSeconds = position / 1000;
private static String generateTime(long position) {
int totalSeconds = (int) (position / 1000);
int seconds = totalSeconds % 60;
int minutes = (totalSeconds / 60) % 60;
......@@ -485,7 +485,7 @@ public class MediaController extends FrameLayout {
if (!fromuser)
return;
int newposition = (mDuration * progress) / 1000;
long newposition = (mDuration * progress) / 1000;
String time = generateTime(newposition);
if (mInstantSeeking)
mPlayer.seekTo(newposition);
......
......@@ -629,7 +629,7 @@ public class VideoView extends SurfaceView implements
@Override
public void seekTo(long msec) {
if (isInPlaybackState()) {
mMediaPlayer.seekTo((int) msec);
mMediaPlayer.seekTo(msec);
mSeekWhenPrepared = 0;
} else {
mSeekWhenPrepared = msec;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册