mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-05 20:22:15 +00:00
Video avatar fixes
This commit is contained in:
parent
28394131a5
commit
1edcf46c79
@ -1212,11 +1212,6 @@ final class PeerInfoAvatarTransformContainerNode: ASDisplayNode {
|
|||||||
let update = {
|
let update = {
|
||||||
videoNode.canAttachContent = !self.isExpanded && self.canAttachVideo
|
videoNode.canAttachContent = !self.isExpanded && self.canAttachVideo
|
||||||
if videoNode.canAttachContent {
|
if videoNode.canAttachContent {
|
||||||
// if let videoStartTimestamp = self.videoStartTimestamp {
|
|
||||||
// videoNode.seek(videoStartTimestamp)
|
|
||||||
// } else {
|
|
||||||
// videoNode.seek(0.0)
|
|
||||||
// }
|
|
||||||
videoNode.play()
|
videoNode.play()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4155,6 +4155,12 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
|||||||
return
|
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 peerId = self.peerId
|
||||||
let _ = (self.context.account.postbox.transaction { transaction -> (Peer?, SearchBotsConfiguration) in
|
let _ = (self.context.account.postbox.transaction { transaction -> (Peer?, SearchBotsConfiguration) in
|
||||||
return (transaction.getPeer(peerId), currentSearchBotsConfiguration(transaction: transaction))
|
return (transaction.getPeer(peerId), currentSearchBotsConfiguration(transaction: transaction))
|
||||||
@ -4184,7 +4190,7 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
|||||||
hasPhotos = true
|
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)
|
let _ = strongSelf.currentAvatarMixin.swap(mixin)
|
||||||
mixin.requestSearchController = { [weak self] assetsController in
|
mixin.requestSearchController = { [weak self] assetsController in
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
@ -5804,22 +5810,6 @@ public final class PeerInfoScreen: ViewController {
|
|||||||
super.displayNodeDidLoad()
|
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) {
|
override public func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
|
||||||
super.containerLayoutUpdated(layout, transition: transition)
|
super.containerLayoutUpdated(layout, transition: transition)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user