0

Ive tried to change starttime and endtime in MediaController class with value that I take from seekbar. But in result, the size of converted video always stop in 140B

 long startTime = -1; //this is what I changed to 0 for example
 long endTime = -1; //this is what I changed to 80 for example

So, how to change this variables to another value when i used seekbar for the trim video? Please help me, I've spent a lot of time for this

Thanks in advance..

Lukmanpryg
  • 166
  • 2
  • 15

1 Answers1

1

Finally, I've got a solution. Change the code in:

 extractor.seekTo(startTime, MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
 if (endTime > 0 && info.presentationTimeUs >= endTime)

to

 extractor.seekTo(startTime * 1000, MediaExtractor.SEEK_TO_CLOSEST_SYNC);
 if (endTime > 0 && info.presentationTimeUs >= (endTime * 1000)) {
Lukmanpryg
  • 166
  • 2
  • 15