Commit e99c9041 by BrainCrumbz Committed by Oliver Woodman

Merge #5126: fix(playlist): always call onCompletion when moving media sources

Imported from GitHub PR https://github.com/google/ExoPlayer/pull/5126

Closes #5125
Merge 55a4c1e15de7f100f37e38119f1da360910fd1e3 into fe41f17c

PiperOrigin-RevId: 222612873
parent 3039c358
...@@ -365,6 +365,9 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo ...@@ -365,6 +365,9 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo
public final synchronized void moveMediaSource( public final synchronized void moveMediaSource(
int currentIndex, int newIndex, @Nullable Runnable actionOnCompletion) { int currentIndex, int newIndex, @Nullable Runnable actionOnCompletion) {
if (currentIndex == newIndex) { if (currentIndex == newIndex) {
if (actionOnCompletion != null) {
actionOnCompletion.run();
}
return; return;
} }
mediaSourcesPublic.add(newIndex, mediaSourcesPublic.remove(currentIndex)); mediaSourcesPublic.add(newIndex, mediaSourcesPublic.remove(currentIndex));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment