mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various improvements
This commit is contained in:
parent
9f9a6365f1
commit
9eddffb694
4 changed files with 12 additions and 1 deletions
|
|
@ -371,6 +371,7 @@ public final class MediaStreamComponent: CombinedComponent {
|
|||
isFullscreen: isFullscreen,
|
||||
videoLoading: context.state.videoStalled,
|
||||
callPeer: context.state.chatPeer,
|
||||
enablePictureInPicture: true,
|
||||
activatePictureInPicture: activatePictureInPicture,
|
||||
deactivatePictureInPicture: deactivatePictureInPicture,
|
||||
bringBackControllerForPictureInPictureDeactivation: { [weak call] completed in
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public final class MediaStreamVideoComponent: Component {
|
|||
let isVisible: Bool
|
||||
let isAdmin: Bool
|
||||
let peerTitle: String
|
||||
let enablePictureInPicture: Bool
|
||||
let activatePictureInPicture: ActionSlot<Action<Void>>
|
||||
let deactivatePictureInPicture: ActionSlot<Void>
|
||||
let bringBackControllerForPictureInPictureDeactivation: (@escaping () -> Void) -> Void
|
||||
|
|
@ -40,6 +41,7 @@ public final class MediaStreamVideoComponent: Component {
|
|||
isFullscreen: Bool,
|
||||
videoLoading: Bool,
|
||||
callPeer: Peer?,
|
||||
enablePictureInPicture: Bool,
|
||||
activatePictureInPicture: ActionSlot<Action<Void>>,
|
||||
deactivatePictureInPicture: ActionSlot<Void>,
|
||||
bringBackControllerForPictureInPictureDeactivation: @escaping (@escaping () -> Void) -> Void,
|
||||
|
|
@ -53,6 +55,7 @@ public final class MediaStreamVideoComponent: Component {
|
|||
self.isAdmin = isAdmin
|
||||
self.peerTitle = peerTitle
|
||||
self.videoLoading = videoLoading
|
||||
self.enablePictureInPicture = enablePictureInPicture
|
||||
self.activatePictureInPicture = activatePictureInPicture
|
||||
self.deactivatePictureInPicture = deactivatePictureInPicture
|
||||
self.bringBackControllerForPictureInPictureDeactivation = bringBackControllerForPictureInPictureDeactivation
|
||||
|
|
@ -90,6 +93,9 @@ public final class MediaStreamVideoComponent: Component {
|
|||
if lhs.videoLoading != rhs.videoLoading {
|
||||
return false
|
||||
}
|
||||
if lhs.enablePictureInPicture != rhs.enablePictureInPicture {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -349,7 +355,7 @@ public final class MediaStreamVideoComponent: Component {
|
|||
UIView.animate(withDuration: 0.3) {
|
||||
videoView.alpha = 1
|
||||
}
|
||||
if let sampleBufferVideoView = videoView as? SampleBufferVideoRenderingView {
|
||||
if component.enablePictureInPicture, let sampleBufferVideoView = videoView as? SampleBufferVideoRenderingView {
|
||||
sampleBufferVideoView.sampleBufferLayer.masksToBounds = true
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
|
|
|
|||
|
|
@ -1000,6 +1000,7 @@ final class StoryItemContentComponent: Component {
|
|||
isFullscreen: false,
|
||||
videoLoading: false,
|
||||
callPeer: nil,
|
||||
enablePictureInPicture: false,
|
||||
activatePictureInPicture: ActionSlot(),
|
||||
deactivatePictureInPicture: ActionSlot(),
|
||||
bringBackControllerForPictureInPictureDeactivation: { f in
|
||||
|
|
|
|||
|
|
@ -951,6 +951,9 @@ public final class StoryItemSetContainerComponent: Component {
|
|||
view.deactivateInput()
|
||||
if self.sendMessageContext.inputMediaNode != nil {
|
||||
self.state?.updated(transition: .spring(duration: 0.4).withUserData(TextFieldComponent.AnimationHint(view: nil, kind: .textFocusChanged(isFocused: false))))
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.state?.updated(transition: .spring(duration: 0.4).withUserData(TextFieldComponent.AnimationHint(view: nil, kind: .textFocusChanged(isFocused: false))))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.state?.updated(transition: .spring(duration: 0.4).withUserData(TextFieldComponent.AnimationHint(view: nil, kind: .textFocusChanged(isFocused: false))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue