From 4b8a6572fd3dac9ead1b7b016fc07893fb065f0d Mon Sep 17 00:00:00 2001 From: olly Date: Mon, 30 Jan 2017 09:32:57 -0800 Subject: [PATCH] Fix resume position if user seeks whilst in error state ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146001900 --- .../com/google/android/exoplayer2/demo/PlayerActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java b/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java index 0badb07cc5..bbfadf34af 100644 --- a/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java +++ b/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java @@ -425,7 +425,12 @@ public class PlayerActivity extends Activity implements OnClickListener, ExoPlay @Override public void onPositionDiscontinuity() { - // Do nothing. + if (playerNeedsSource) { + // This will only occur if the user has performed a seek whilst in the error state. Update the + // resume position so that if the user then retries, playback will resume from the position to + // which they seeked. + updateResumePosition(); + } } @Override