Video avatar fixes

This commit is contained in:
Ilya Laktyushin 2020-07-15 17:36:54 +03:00
parent a1d8287991
commit f7f7afcc29
3 changed files with 12 additions and 1 deletions

View File

@ -935,6 +935,7 @@ public class GalleryController: ViewController, StandalonePresentableController
self.galleryNode.controlsVisibilityChanged = { [weak self] visible in
self?.prefersOnScreenNavigationHidden = !visible
self?.galleryNode.pager.centralItemNode()?.controlsVisibilityUpdated(isVisible: visible)
}
let baseNavigationController = self.baseNavigationController

View File

@ -82,6 +82,9 @@ open class GalleryItemNode: ASDisplayNode {
open func visibilityUpdated(isVisible: Bool) {
}
open func controlsVisibilityUpdated(isVisible: Bool) {
}
open func animateIn(from node: (ASDisplayNode, CGRect, () -> (UIView?, UIView?)), addToTransitionSurface: (UIView) -> Void, completion: @escaping () -> Void) {
}

View File

@ -661,7 +661,9 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
seekable = value.duration >= 30.0
}
if playing && strongSelf.previousPlaying != true && !disablePlayerControls {
if strongSelf.isCentral && playing && strongSelf.previousPlaying != true && !disablePlayerControls {
strongSelf.controlsTimer?.invalidate()
let timer = SwiftSignalKit.Timer(timeout: 3.0, repeat: false, completion: { [weak self] in
self?.updateControlsVisibility(false)
self?.controlsTimer = nil
@ -762,6 +764,11 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
self.footerContentNode.setup(origin: item.originData, caption: item.caption)
}
override func controlsVisibilityUpdated(isVisible: Bool) {
self.controlsTimer?.invalidate()
self.controlsTimer = nil
}
private func updateDisplayPlaceholder(_ displayPlaceholder: Bool) {
if displayPlaceholder {
if self.pictureInPictureNode == nil {