Skip to content

Instantly share code, notes, and snippets.

@ojw28
Created September 1, 2016 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ojw28/5850ea8dec13946e427dea1ecdef5971 to your computer and use it in GitHub Desktop.
Save ojw28/5850ea8dec13946e427dea1ecdef5971 to your computer and use it in GitHub Desktop.
MediaSource firstSource = new ExtractorMediaSource(firstVideoUri, ...);
MediaSource secondSource = new ExtractorMediaSource(secondVideoUri, ...);
// Plays the first video twice, then the second video.
ConcatenatingMediaSource concatenatedSource =
new ConcatenatingMediaSource(firstSource, firstSource, secondSource);
// Loops the sequence indefinitely.
LoopingMediaSource compositeSource = new LoopingMediaSource(concatenatedSource);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment