Exoplayer not playing large local videos correctly

Viewed 124

I'm using Exoplayer to play local videos. Videos of small sizes <50mb are playing correctly but if I try to play a movie, it starts displaying several issues including : Not being able to drag timebar to a specific position Displaying the wrong total duration Video playing slowly for a start then stopping entirely. This is the code I'm using to initialize my player

if (currentPosition != null) {
MEDIA_ITEMS = new ArrayList<>();
for (Video video : videoList) {
MEDIA_ITEMS.add(MediaItem.fromUri(video.getPath()));
 }
video = videoList.get(currentPosition); 
textViewTitle.setText(video.getTitle());
simpleExoPlayer.addMediaItems(MEDIA_ITEMS);
simpleExoPlayer.seekTo(currentPosition, position.getDuration()); 
simpleExoPlayer.prepare(); 
simpleExoPlayer.play();
}

screenshot of Exoplayer showing wrong total duration (circled)

The correct duration to show is 2:12:5

How do I fix this, everything is working perfectly apart from this large video issue. Your answers are highly appreciated. Thank you

0 Answers
Related