mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various improvements
This commit is contained in:
@@ -83,6 +83,17 @@ public extension MediaEditorScreen {
|
||||
transitionOut: nil
|
||||
)
|
||||
|
||||
var videoPlaybackPosition = videoPlaybackPosition
|
||||
if cover, case let .file(file) = storyItem.media {
|
||||
videoPlaybackPosition = 0.0
|
||||
for attribute in file.attributes {
|
||||
if case let .Video(_, _, _, _, coverTime) = attribute {
|
||||
videoPlaybackPosition = coverTime
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var updateProgressImpl: ((Float) -> Void)?
|
||||
let controller = MediaEditorScreen(
|
||||
context: context,
|
||||
@@ -248,7 +259,7 @@ public extension MediaEditorScreen {
|
||||
var updatedAttributes: [TelegramMediaFileAttribute] = []
|
||||
for attribute in file.attributes {
|
||||
if case let .Video(duration, size, flags, preloadSize, _) = attribute {
|
||||
updatedAttributes.append(.Video(duration: duration, size: size, flags: flags, preloadSize: preloadSize, coverTime: updatedCoverTimestamp))
|
||||
updatedAttributes.append(.Video(duration: duration, size: size, flags: flags, preloadSize: preloadSize, coverTime: min(duration, updatedCoverTimestamp)))
|
||||
} else {
|
||||
updatedAttributes.append(attribute)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user