I am designing an android video editor app and one of the feature is to trim video, selected from gallery. I can give an option to select the range using the RangeSlider, displayed at the bottom of the VideoView, to the user and then use FFMPEG library to trim the video.
But i am not able to show the progress of the video being played, within the selected range, on the RangeSlider.
Not sure if i am approaching properly, hence please provide me a solution to achieve this.
When you change the bounds of the RangeSlider, you need to calculate the startTime and endTime of the video. Once you are able to calculate the startTime and endTime, you need to create a ClippingMediaSource instance.
ClippingMediaSource takes three paramters:
You can create media source by following the below snippet:
After creating the MediaSource you can pass on the values for start and end time you had calculated.
Once done, you can pass this media source to your ExoPlayer and it will play only the selected/trimmed part of your video.