|
|
|
|
@ -813,6 +813,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis |
|
|
|
|
mHistory = History.find(getHistoryKey()); |
|
|
|
|
mHistory = mHistory == null ? createHistory(item) : mHistory; |
|
|
|
|
if (!TextUtils.isEmpty(getMark())) mHistory.setVodRemarks(getMark()); |
|
|
|
|
if (!getSite().isRecordable() && mHistory.getKey().equals(getHistoryKey())) mHistory.delete(); |
|
|
|
|
mBinding.control.opening.setText(mHistory.getOpening() == 0 ? getString(R.string.play_op) : mPlayers.stringToTime(mHistory.getOpening())); |
|
|
|
|
mBinding.control.ending.setText(mHistory.getEnding() == 0 ? getString(R.string.play_ed) : mPlayers.stringToTime(mHistory.getEnding())); |
|
|
|
|
mBinding.control.speed.setText(mPlayers.setSpeed(mHistory.getSpeed())); |
|
|
|
|
@ -865,10 +866,11 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onTimeChanged() { |
|
|
|
|
long current = mPlayers.getPosition(); |
|
|
|
|
long duration = mPlayers.getDuration(); |
|
|
|
|
if (current >= 0 && duration > 0 && getSite().isRecordable()) App.execute(() -> mHistory.update(current, duration)); |
|
|
|
|
if (mHistory.getEnding() > 0 && duration > 0 && mHistory.getEnding() + current >= duration) { |
|
|
|
|
long position, duration; |
|
|
|
|
mHistory.setPosition(position = mPlayers.getPosition()); |
|
|
|
|
mHistory.setDuration(duration = mPlayers.getDuration()); |
|
|
|
|
if (position >= 0 && duration > 0 && getSite().isRecordable()) App.execute(() -> mHistory.update()); |
|
|
|
|
if (mHistory.getEnding() > 0 && duration > 0 && mHistory.getEnding() + position >= duration) { |
|
|
|
|
Clock.get().setCallback(null); |
|
|
|
|
checkNext(); |
|
|
|
|
} |
|
|
|
|
@ -905,7 +907,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setPosition() { |
|
|
|
|
if (getSite().isRecordable()) mPlayers.seekTo(Math.max(mHistory.getOpening(), mHistory.getPosition()), false); |
|
|
|
|
mPlayers.seekTo(Math.max(mHistory.getOpening(), mHistory.getPosition()), false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void checkEnded() { |
|
|
|
|
|