Skip to content

Instantly share code, notes, and snippets.

@TOrnelas
Created June 29, 2017 14:41
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 TOrnelas/b221ef5972e914559376e7fb6cfbc23e to your computer and use it in GitHub Desktop.
Save TOrnelas/b221ef5972e914559376e7fb6cfbc23e to your computer and use it in GitHub Desktop.
private void playNextVideo(){
for (int i = 0; i < contentArrayList.size(); i++){
if (contentArrayList.get(i).isPlaying()){
if (i == contentArrayList.size() - 1)
finish();
url = "https://cdnapisec.kaltura.com/p/309/sp/0/playManifest/entryId/" +
contentArrayList.get(i + 1).getIdKaltura()
+"/format/applehttp/protocol/http/flavorParamId/301971/manifest.m3u8";
contentArrayList.get(i).setIsPlaying(false)
contentArrayList.get(i + 1).setIsPlaying(true);
adapter.notifyDataSetChanged();
playVideo(url, ExoPlayer2Interface.VIDEO_HLS);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment