Skip to content

Instantly share code, notes, and snippets.

@ojw28
Created September 12, 2020 23:07
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/958e587934fbf92418c20c2f15fff627 to your computer and use it in GitHub Desktop.
Save ojw28/958e587934fbf92418c20c2f15fff627 to your computer and use it in GitHub Desktop.
// Play a list of URIs as a playlist.
List<MediaItem> mediaItems = new ArrayList<>();
for (int i = 0; i < videoUris.length; i++) {
mediaItems.add(MediaItem.fromUri(videoUris[i]));
}
// Set the playlist, prepare and play.
player.setMediaItems(mediaItems);
player.prepare();
player.play()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment