mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Video avatar fixes
This commit is contained in:
@@ -5069,11 +5069,16 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
self.keepPeerInfoScreenDataHotDisposable.set(keepPeerInfoScreenDataHot(context: context, peerId: peerId).start())
|
||||
self.preloadAvatarDisposable.set((peerInfoProfilePhotosWithCache(context: context, peerId: peerId)
|
||||
|> mapToSignal { result -> Signal<Never, NoError> in
|
||||
if let video = result.first?.videoRepresentations.first {
|
||||
let duration: Double = (video.representation.startTimestamp ?? 0.0) + 4.0
|
||||
return preloadVideoResource(postbox: context.account.postbox, resourceReference: video.reference, duration: duration)
|
||||
var signals: [Signal<Never, NoError>] = [.complete()]
|
||||
for i in 0 ..< min(5, result.count) {
|
||||
if let video = result[i].videoRepresentations.first {
|
||||
let duration: Double = (video.representation.startTimestamp ?? 0.0) + (i == 0 ? 4.0 : 2.0)
|
||||
signals.append(preloadVideoResource(postbox: context.account.postbox, resourceReference: video.reference, duration: duration))
|
||||
}
|
||||
}
|
||||
return combineLatest(signals) |> mapToSignal { _ in
|
||||
return .never()
|
||||
}
|
||||
return .complete()
|
||||
}).start())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user