Skip to content

Instantly share code, notes, and snippets.

@ojw28
Last active September 1, 2016 15:21
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/bddd6b6b98cf0b5185728394df49dea4 to your computer and use it in GitHub Desktop.
Save ojw28/bddd6b6b98cf0b5185728394df49dea4 to your computer and use it in GitHub Desktop.
MediaSource firstSource = new ExtractorMediaSource(firstVideoUri, ...);
MediaSource secondSource = new ExtractorMediaSource(secondVideoUri, ...);
// Plays the first video twice.
LoopingMediaSource firstSourceTwice = new LoopingMediaSource(firstSource, 2);
// Plays the first video twice, then the second video.
ConcatenatingMediaSource concatenatedSource =
new ConcatenatingMediaSource(firstSourceTwice, 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