Various improvements

This commit is contained in:
Ilya Laktyushin
2024-07-25 00:54:36 +02:00
parent b006c36c59
commit 8120dde68c
21 changed files with 400 additions and 168 deletions

View File

@@ -674,7 +674,17 @@ public final class TelegramRootController: NavigationController, TelegramRootCon
return nil
}
}
media = .video(dimensions: dimensions, duration: duration, resource: resource, firstFrameFile: firstFrameFile, stickers: result.stickers, coverTime: values.coverImageTimestamp)
var coverTime: Double?
if let coverImageTimestamp = values.coverImageTimestamp {
if let trimRange = values.videoTrimRange {
coverTime = coverImageTimestamp - trimRange.lowerBound
} else {
coverTime = coverImageTimestamp
}
}
media = .video(dimensions: dimensions, duration: duration, resource: resource, firstFrameFile: firstFrameFile, stickers: result.stickers, coverTime: coverTime)
}
default:
break