I need to set duration of a video for a thumbnail to 5 seconds and loop it. I got the loop part, but I can't find documentation for setting specific duration
I tried exoPlayer.seek(duration) but that didn't work
I need to set duration of a video for a thumbnail to 5 seconds and loop it. I got the loop part, but I can't find documentation for setting specific duration
I tried exoPlayer.seek(duration) but that didn't work
You may use ClippingMediaSource
:
ClippingMediaSource​(MediaSource mediaSource, long startPositionUs, long endPositionUs)
Creates a new clipping source that wraps the specified source and provides samples between the specified start and end position.
You can convert to have a new media source and set this new media source for your ExoPlayer:
// Create a new media source with your specified period
val newMediaSource = ClippingMediaSource(mediaSource, 0, 5_000_000)