mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-08 19:10:53 +00:00
Video message recording improvements
This commit is contained in:
parent
f34d0913df
commit
42421342b8
@ -1022,6 +1022,16 @@ public class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewI
|
||||
return rects
|
||||
}
|
||||
|
||||
public func animateInstantVideoFromSnapshot(snapshotView: UIView, transition: CombinedTransition) {
|
||||
for contentNode in self.contentNodes {
|
||||
if let contentNode = contentNode as? ChatMessageInstantVideoBubbleContentNode {
|
||||
snapshotView.frame = contentNode.interactiveVideoNode.view.convert(snapshotView.frame, from: self.view)
|
||||
contentNode.interactiveVideoNode.animateFromSnapshot(snapshotView: snapshotView, transition: transition)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public func didLoad() {
|
||||
super.didLoad()
|
||||
|
||||
|
@ -1778,9 +1778,16 @@ public class ChatMessageInteractiveInstantVideoNode: ASDisplayNode {
|
||||
if !self.animatedFadeIn {
|
||||
self.animatedFadeIn = true
|
||||
self.dateAndStatusNode.layer.animateAlpha(from: 0.0, to: self.dateAndStatusNode.alpha, duration: 0.15, delay: 0.18)
|
||||
|
||||
if let durationNode = self.durationNode {
|
||||
durationNode.layer.animateAlpha(from: 0.0, to: durationNode.alpha, duration: 0.15, delay: 0.18)
|
||||
}
|
||||
if let durationBackgroundNode = self.durationBackgroundNode {
|
||||
durationBackgroundNode.layer.animateAlpha(from: 0.0, to: durationBackgroundNode.alpha, duration: 0.15, delay: 0.18)
|
||||
}
|
||||
if let audioTranscriptionButton = self.audioTranscriptionButton {
|
||||
audioTranscriptionButton.layer.animateAlpha(from: 0.0, to: audioTranscriptionButton.alpha, duration: 0.15, delay: 0.18)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -310,6 +310,8 @@ private final class VideoMessageCameraScreenComponent: CombinedComponent {
|
||||
|
||||
let viewOnceButton = Child(PlainButtonComponent.self)
|
||||
let recordMoreButton = Child(PlainButtonComponent.self)
|
||||
|
||||
let muteIcon = Child(ZStack<Empty>.self)
|
||||
|
||||
return { context in
|
||||
let environment = context.environment[ViewControllerComponentContainer.Environment.self].value
|
||||
@ -455,6 +457,35 @@ private final class VideoMessageCameraScreenComponent: CombinedComponent {
|
||||
)
|
||||
}
|
||||
|
||||
if component.isPreviewing && component.isMuted {
|
||||
let muteIcon = muteIcon.update(
|
||||
component: ZStack([
|
||||
AnyComponentWithIdentity(
|
||||
id: "background",
|
||||
component: AnyComponent(
|
||||
RoundedRectangle(color: UIColor(rgb: 0x000000, alpha: 0.3), cornerRadius: 24.0)
|
||||
)
|
||||
),
|
||||
AnyComponentWithIdentity(
|
||||
id: "icon",
|
||||
component: AnyComponent(
|
||||
BundleIconComponent(
|
||||
name: "Chat/Message/InstantVideoMute",
|
||||
tintColor: .white
|
||||
)
|
||||
)
|
||||
)
|
||||
]),
|
||||
availableSize: CGSize(width: 24.0, height: 24.0),
|
||||
transition: context.transition
|
||||
)
|
||||
context.add(muteIcon
|
||||
.position(CGPoint(x: component.previewFrame.midX, y: component.previewFrame.maxY - 24.0))
|
||||
.appear(.default(scale: true, alpha: true))
|
||||
.disappear(.default(scale: true, alpha: true))
|
||||
)
|
||||
}
|
||||
|
||||
return availableSize
|
||||
}
|
||||
}
|
||||
@ -1466,7 +1497,7 @@ public class VideoMessageCameraScreen: ViewController {
|
||||
}
|
||||
|
||||
public func hideVideoSnapshot() {
|
||||
self.node.previewContainerView.alpha = 0.02
|
||||
self.node.previewContainerView.isHidden = true
|
||||
}
|
||||
|
||||
public func updateTrimRange(start: Double, end: Double, updatedEnd: Bool, apply: Bool) {
|
||||
|
@ -635,7 +635,7 @@ public final class ChatMessageTransitionNodeImpl: ASDisplayNode, ChatMessageTran
|
||||
case let .videoMessage(videoMessage):
|
||||
let combinedTransition = CombinedTransition(horizontal: .animated(duration: horizontalDuration, curve: ChatMessageTransitionNodeImpl.horizontalAnimationCurve), vertical: .animated(duration: verticalDuration, curve: ChatMessageTransitionNodeImpl.verticalAnimationCurve))
|
||||
|
||||
if let itemNode = self.itemNode as? ChatMessageInstantVideoItemNode {
|
||||
if let itemNode = self.itemNode as? ChatMessageBubbleItemNode {
|
||||
itemNode.cancelInsertionAnimations()
|
||||
|
||||
self.contextSourceNode.isExtractedToContextPreview = true
|
||||
@ -659,7 +659,7 @@ public final class ChatMessageTransitionNodeImpl: ASDisplayNode, ChatMessageTran
|
||||
strongSelf.endAnimation()
|
||||
})
|
||||
|
||||
itemNode.animateFromSnapshot(snapshotView: videoMessage.view, transition: combinedTransition)
|
||||
itemNode.animateInstantVideoFromSnapshot(snapshotView: videoMessage.view, transition: combinedTransition)
|
||||
}
|
||||
case let .mediaInput(mediaInput):
|
||||
if let snapshotView = mediaInput.extractSnapshot() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user