Various improvements

This commit is contained in:
Ilya Laktyushin
2024-07-24 10:28:56 +04:00
parent 9ba0743553
commit b006c36c59
13 changed files with 95 additions and 41 deletions

View File

@@ -1508,7 +1508,15 @@ public final class MediaEditor {
public func setVideoTrimRange(_ trimRange: Range<Double>, apply: Bool) {
self.updateValues(mode: .skipRendering) { values in
return values.withUpdatedVideoTrimRange(trimRange)
var updatedValues = values.withUpdatedVideoTrimRange(trimRange)
if let coverImageTimestamp = updatedValues.coverImageTimestamp {
if coverImageTimestamp < trimRange.lowerBound {
updatedValues = updatedValues.withUpdatedCoverImageTimestamp(trimRange.lowerBound)
} else if coverImageTimestamp > trimRange.upperBound {
updatedValues = updatedValues.withUpdatedCoverImageTimestamp(trimRange.upperBound)
}
}
return updatedValues
}
if apply {