mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Improve HLS video thumbnail generation
This commit is contained in:
parent
2739a839ed
commit
cebe18e6d6
3 changed files with 250 additions and 5 deletions
|
|
@ -76,6 +76,31 @@ public final class CachedVideoFirstFrameRepresentation: CachedMediaResourceRepre
|
|||
}
|
||||
}
|
||||
|
||||
public final class CachedVideoPrefixFirstFrameRepresentation: CachedMediaResourceRepresentation {
|
||||
public let keepDuration: CachedMediaRepresentationKeepDuration = .general
|
||||
|
||||
public var uniqueId: String {
|
||||
return "prefix-first-frame"
|
||||
}
|
||||
|
||||
public let prefixLength: Int32
|
||||
|
||||
public init(prefixLength: Int32) {
|
||||
self.prefixLength = prefixLength
|
||||
}
|
||||
|
||||
public func isEqual(to: CachedMediaResourceRepresentation) -> Bool {
|
||||
if let to = to as? CachedVideoPrefixFirstFrameRepresentation {
|
||||
if self.prefixLength != to.prefixLength {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final class CachedScaledVideoFirstFrameRepresentation: CachedMediaResourceRepresentation {
|
||||
public let keepDuration: CachedMediaRepresentationKeepDuration = .general
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue