diff --git a/submodules/FetchManagerImpl/Sources/FetchManagerImpl.swift b/submodules/FetchManagerImpl/Sources/FetchManagerImpl.swift index d12be7953c..5e1e3c33eb 100644 --- a/submodules/FetchManagerImpl/Sources/FetchManagerImpl.swift +++ b/submodules/FetchManagerImpl/Sources/FetchManagerImpl.swift @@ -597,6 +597,9 @@ private func filterDownloadStatsEntry(entry: FetchManagerLocationEntry) -> Bool return false } } + if file.isInstantVideo { + return false + } if file.isSticker { return false } diff --git a/submodules/TelegramCallsUI/Sources/Components/MediaStreamVideoComponent.swift b/submodules/TelegramCallsUI/Sources/Components/MediaStreamVideoComponent.swift index cba30e1df5..f9d7bfc884 100644 --- a/submodules/TelegramCallsUI/Sources/Components/MediaStreamVideoComponent.swift +++ b/submodules/TelegramCallsUI/Sources/Components/MediaStreamVideoComponent.swift @@ -61,6 +61,8 @@ final class MediaStreamVideoComponent: Component { } private let videoRenderingContext = VideoRenderingContext() + private let blurTintView: UIView + private var videoBlurView: VideoRenderingView? private var videoView: VideoRenderingView? private var activityIndicatorView: ComponentHostView? private var noSignalView: ComponentHostView? @@ -76,10 +78,15 @@ final class MediaStreamVideoComponent: Component { private weak var state: State? override init(frame: CGRect) { + self.blurTintView = UIView() + self.blurTintView.backgroundColor = UIColor(white: 0.0, alpha: 0.55) + super.init(frame: frame) self.isUserInteractionEnabled = false self.clipsToBounds = true + + self.addSubview(self.blurTintView) } required init?(coder: NSCoder) { @@ -102,6 +109,12 @@ final class MediaStreamVideoComponent: Component { if component.hasVideo, self.videoView == nil { if let input = component.call.video(endpointId: "unified") { + if let videoBlurView = self.videoRenderingContext.makeView(input: input, blur: true) { + self.videoBlurView = videoBlurView + self.insertSubview(videoBlurView, belowSubview: self.blurTintView) + } + + if let videoView = self.videoRenderingContext.makeView(input: input, blur: false, forceSampleBufferDisplayLayer: true) { self.videoView = videoView self.addSubview(videoView) @@ -191,8 +204,15 @@ final class MediaStreamVideoComponent: Component { } let videoSize = CGSize(width: aspect * 100.0, height: 100.0).aspectFitted(availableSize) + let blurredVideoSize = videoSize.aspectFilled(availableSize) transition.withAnimation(.none).setFrame(view: videoView, frame: CGRect(origin: CGPoint(x: floor((availableSize.width - videoSize.width) / 2.0), y: floor((availableSize.height - videoSize.height) / 2.0)), size: videoSize), completion: nil) + + if let videoBlurView = self.videoBlurView { + videoBlurView.updateIsEnabled(component.isVisible) + + transition.withAnimation(.none).setFrame(view: videoBlurView, frame: CGRect(origin: CGPoint(x: floor((availableSize.width - blurredVideoSize.width) / 2.0), y: floor((availableSize.height - blurredVideoSize.height) / 2.0)), size: blurredVideoSize), completion: nil) + } } if !self.hadVideo { diff --git a/submodules/TgVoipWebrtc/tgcalls b/submodules/TgVoipWebrtc/tgcalls index 4f3f4025b9..a9b79b4110 160000 --- a/submodules/TgVoipWebrtc/tgcalls +++ b/submodules/TgVoipWebrtc/tgcalls @@ -1 +1 @@ -Subproject commit 4f3f4025b9b4ad9662612636af10e6fd5d204535 +Subproject commit a9b79b4110e6f2388bcc548cf27c48998d85e1b3