mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-31 09:52:04 +00:00
Video avatar fixes
This commit is contained in:
parent
28394131a5
commit
1edcf46c79
@ -1212,11 +1212,6 @@ final class PeerInfoAvatarTransformContainerNode: ASDisplayNode {
|
||||
let update = {
|
||||
videoNode.canAttachContent = !self.isExpanded && self.canAttachVideo
|
||||
if videoNode.canAttachContent {
|
||||
// if let videoStartTimestamp = self.videoStartTimestamp {
|
||||
// videoNode.seek(videoStartTimestamp)
|
||||
// } else {
|
||||
// videoNode.seek(0.0)
|
||||
// }
|
||||
videoNode.play()
|
||||
}
|
||||
}
|
||||
|
@ -4155,6 +4155,12 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
||||
return
|
||||
}
|
||||
|
||||
var currentIsVideo = false
|
||||
let item = self.headerNode.avatarListNode.listContainerNode.currentItemNode?.item
|
||||
if let item = item, case let .image(image) = item {
|
||||
currentIsVideo = !image.2.isEmpty
|
||||
}
|
||||
|
||||
let peerId = self.peerId
|
||||
let _ = (self.context.account.postbox.transaction { transaction -> (Peer?, SearchBotsConfiguration) in
|
||||
return (transaction.getPeer(peerId), currentSearchBotsConfiguration(transaction: transaction))
|
||||
@ -4184,7 +4190,7 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
||||
hasPhotos = true
|
||||
}
|
||||
|
||||
let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: hasPhotos && hasRemove, hasViewButton: false, personalPhoto: strongSelf.isSettings, isVideo: false, saveEditedPhotos: false, saveCapturedMedia: false, signup: false)!
|
||||
let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: hasPhotos && hasRemove, hasViewButton: false, personalPhoto: strongSelf.isSettings, isVideo: currentIsVideo, saveEditedPhotos: false, saveCapturedMedia: false, signup: false)!
|
||||
let _ = strongSelf.currentAvatarMixin.swap(mixin)
|
||||
mixin.requestSearchController = { [weak self] assetsController in
|
||||
guard let strongSelf = self else {
|
||||
@ -5803,23 +5809,7 @@ public final class PeerInfoScreen: ViewController {
|
||||
|
||||
super.displayNodeDidLoad()
|
||||
}
|
||||
|
||||
public override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
self.controllerNode.canAttachVideo = false
|
||||
}
|
||||
|
||||
override public func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
self.controllerNode.canAttachVideo = true
|
||||
|
||||
if let (layout, navigationHeight) = self.validLayout {
|
||||
self.controllerNode.containerLayoutUpdated(layout: layout, navigationHeight: navigationHeight, transition: .immediate)
|
||||
}
|
||||
}
|
||||
|
||||
override public func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
|
||||
super.containerLayoutUpdated(layout, transition: transition)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user