@Override public void recordDisconnectTime() { if (MovieUtils.isRtspOrSdp(getPlayer().getVideoType())) { // record the time disconnect from server mLastDisconnectTime = System.currentTimeMillis(); } if (LOG) { Log.v(TAG, "recordDisconnectTime() mLastDisconnectTime=" + mLastDisconnectTime); } }
@Override public boolean handleOnResume() { if (mIsShowDialog && !MovieUtils.isLiveStreaming(getPlayer().getVideoType())) { // wait for user's operation return true; } if (!passDisconnectCheck()) { return true; } return false; }
private boolean passDisconnectCheck() { if (MovieUtils.isRtspOrSdp(getPlayer().getVideoType())) { // record the time disconnect from server long now = System.currentTimeMillis(); if (LOG) { Log.v( TAG, "passDisconnectCheck() now=" + now + ", mLastDisconnectTime=" + mLastDisconnectTime + ", mServerTimeout=" + mServerTimeout); } if (mServerTimeout > 0 && (now - mLastDisconnectTime) > mServerTimeout) { // disconnect time more than server timeout, notify user notifyServerTimeout(); return false; } } return true; }