I have questions about the ConcatenatingMediaSource . I need to play several videos and every time one video ends, I have to check one method. But in the case of ConcatenatingMediaSource , he lets me know about the completion after the most recent video, that is, at the end of the video list.

 MediaSource mediaSource; for(int i = 0; i < videoList.size; i++){ mediaSource = new ExtractorMediaSource(Uri.parse(Application.video_path + video.getName()), dataSourceFactory, extractorsFactory, null, null); } ConcatenatingMediaSource concatenatedSource = new ConcatenatingMediaSource( mediaSources.toArray(new MediaSource[mediaSources.size()])); player.prepare(concatenatedSource); player.setPlayWhenReady(true); 

Question : How to get STATE_ENDED after each video or how to understand in ConcatenatingMediaSource that some video has ended to check the type of this?

 if (firstVideo = STATE_ENDED){ textView.setText(video.getName); ////// 

And is it still possible to send a class to the ExtractorMediaSource instead of the uri to the file?

    0