I'm using ExoPlayer to play a list of videos as playlist:
MediaSource[] mediaSources = new MediaSource[mList.size()];
for (int i = 0; i < mList.size(); i++) {
mediaSources[i] = buildMediaSource(Uri.parse(mList.get(i));
}
MediaSource mediaSource = mediaSources.length == 1 ? mediaSources[0]
: new ConcatenatingMediaSource(mediaSources);
mExoPlayer.prepare(mediaSource);
Its working fine. But as per requirement I have to play a video in a particular position from the list when click. How can I achieve this?
Thanks!
You may want to use seekTo(windowIndex, positionMs).
player.prepare(mediaSource);
player.seek(3, C.TIME_UNSET);
player.setPlayWhenReady(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With