freddyfang / android-video-trimmer

Video trimmer widget
61 stars 25 forks source link

On video frames scrolling, start and end milliseconds value in listener return at initial parameters #3

Open thorny84 opened 4 years ago

thorny84 commented 4 years ago

Suppose i have a video of 00:20 time, and i set a maximum trim of 00:10, if i scroll the video frames until the end, i will have a trim from 00:10 to 00:20. But if i move the right cursor to the left, the values ​​return to the previous ones.

Integrating the library I solved this by modifying VideoTrimmerPresenter.kt method:

    override fun onDragRangeBarEnd(left: Float, right: Float) {
        calculateSelectedArea(left, right)
        onSelectedRangeChangedListener?.onSelectRangeEnd(rawStartMillis, rawEndMillis)
    }

in this:

    override fun onDragRangeBarEnd(left: Float, right: Float) {
        calculateSelectedArea(left, right)
        onSelectedRangeChangedListener?.onSelectRangeEnd(startMillis, endMillis)
    }

I look forward to getting feedback :] thanks

Jeel7584 commented 1 year ago

@thorny84 i got same issues you have found any solutions ?. and also when i scroll frame to end without drag right and left bars and my maximum trim set to 30 second but start time show 14 second and end time show 36 second.

without scroll left and right bar endtime and start time different shown equal to max trim duration.